Answer the question
In order to leave comments, you need to log in
Wrong encoding when downloading excel file via python 3. How to fix?
Script code:
import requests
file = requests.get("https://login:[email protected]/export/[email protected]/myshop/prices.xls")
f = open("priceRF.xls", "wb")
f.write(file.text.encode('cp65001'))
f.close()
print("Done!")
f = open("priceRF.csv", "w")
f.write(file.text)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question