requests.get()爬去中文網頁亂碼解決方法

requests.get()爬去中文網頁亂碼解決方法 當我們使用requests.get()爬取百度首頁時會發現,返回的html代碼中的中文發生亂碼。 import requests headers = {'User-Agent' : 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko)
相關文章
相關標籤/搜索