11问答网
所有问题
python 使用requests 访问 繁体字网站会出现乱码,不知怎么解决
如题所述
举报该问题
其他回答
第1个回答 2017-04-20
解决方案:
1.
http://stackoverflow.com/questions/3122145/zlib-error-error-3-while-decompressing-incorrect-header-check
2.
http://blog.csdn.net/pxf1234567/article/details/42006697
3.
http://blog.csdn.net/bytxl/article/details/21278249
本回答被提问者采纳
第2个回答 2017-04-20
通过encode方法转换编码
相似回答
python
用requests
和BeautifulSoup捉去
网站
上的火星文 为什么
会乱码
...
答:
编码问题!你在网站上右键,查看下源码代码 meta http-equiv="content-type" content="text/html;charset=gbk" />这个是百度知道,你可以看下你采集的网站的编码,然后用beautifulsoup的时候就需要设置啊 htmlCharset = "GB2312"soup = BeautifulSoup(respHtml, fromEncoding=htmlCharset)BeautifulSoup默认检...
大家正在搜
相关问题
Python+requests 爬取网站遇到中文乱码怎么办
python爬虫抓下来的网页,中间的中文乱码怎么解决
Python+requests 爬取网站遇到中文乱码怎么办
Python+requests 爬取网站遇到中文乱码怎么办
Python+requests 爬取网站遇到中文乱码怎么办
Python+requests 爬取网站遇到中文乱码怎么办
Python+requests 爬取网站遇到中文乱码怎么办
python 用requests获取网页源代码为什么中文显示...