爬虫3 requests基础之 乱码编码问题

import requests
res = requests.get('http://www.quanshuwang.com')
res.encoding = 'gbk'
print(res.text)

html中若有编码   在html中Ctrl+f 搜索charset查看网站的编码方式

然后res.encoding=。。。 加上编码格式,再打印

posted @ 2019-01-14 19:22  山…隹  阅读(230)  评论(0编辑  收藏  举报