20/08/27 18:02:56.98 ygBOOYPT.net
import requests
from bs4 import BeautifulSoup
url = "URLリンク(www.yahoo.co.jp)
response = requests.get(url)
#response.encoding = response.apparent_encoding
with open('hoge.html', 'w') as file:
file.write(response.text)
print(response.encoding)
取得したyahooが文字化けするんですが、何が原因かわかりませんか?
文字コードはutf8になるので、これで問題ないはずですが、、、