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

we are a community of more than 2 million smartest coders
registration for
employee referral programs
are now open
get referred to google, amazon, flipkart and more
register now
  
pinned-register now
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()