datafile = open(localfile, "w", encoding="utf-8") datafile.write(page.text) datafile.close()
datafile = open(localfile, "wb") datafile.write(page.content) datafile.close()