访问生活114 返回乱码解决方法

html = requests.get('http://s.114chn.com/s-o65ivdsi', headers=headers,proxies = proxies)

# 第一种方法
# print(html.encoding) # ISO-8859-1
# html.encoding="utf-8" # 改变返回对象的编码格式
# print(html.text)

# 第二种方法
html = html.text.encode('latin1').decode('utf-8')
print(html)
原文地址:https://www.cnblogs.com/liuyoushui/p/9110154.html