html ISO-8859-1编码乱码问题
2019-01-30 本文已影响0人
丷菜菜呀
解决方法,编码方式重定义为utf-8编码
resp = requests.get(start_url,headers=headers)
print(resp.encoding)
ISO-8859-1
resp.encoding ='utf-8'
print(resp.content.decode(resp.encoding))
解决方法,编码方式重定义为utf-8编码
resp = requests.get(start_url,headers=headers)
print(resp.encoding)
ISO-8859-1
resp.encoding ='utf-8'
print(resp.content.decode(resp.encoding))