- html = requests.get(url,headers = head)
- html.apparent_encoding
- html.encoding = html.apparent_encoding
- print html.text
不要指定为utf-8,从apparent_encoding内读,缺省为utf-8就好了
文件头加:
- import sys
- reload(sys)
- sys.setdefaultencoding(“utf-8”)
不要指定为utf-8,从apparent_encoding内读,缺省为utf-8就好了
文件头加: