python write request must be str not bytes

Solutions on MaxInterview for python write request must be str not bytes by the best coders in the world

showing results for - "python write request must be str not bytes"
Nena
11 Jan 2017
1datafile = open(localfile, "w", encoding="utf-8")
2datafile.write(page.text)
3datafile.close()
Daniele
27 Mar 2019
1datafile = open(localfile, "wb")
2datafile.write(page.content)
3datafile.close()