url=r‘http://www.test.com/test.html‘ html=requests.get(url,headers=header) codetype=html.encoding#获取网页编码类型 html.encoding=‘GBK‘#更改网页编码类型 print(html.text)
python3 爬虫乱码问题
原文:http://www.cnblogs.com/kearney908/p/7605507.html