import chardet
# 解决乱码问题
code = chardet.detect(response.content)["encoding"] # 获取编码格式
response.encoding = code # 指定编码格式
爬虫:解决乱码问题
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章
【Python爬虫】基本原理和框架
Mercy92
2020-07-08 10:40:50
【Python 爬虫】使用友盟API获取数据
Mercy92
2020-07-08 10:40:48
【Python 爬虫】使用新榜API获取数据
Mercy92
2020-07-08 10:40:48
Python爬虫精简步骤 HTML基础(上)
Lora鳃鳃
2020-07-07 11:50:32
一个简单的校园网登录程序 || 爬虫+tkinter
阿腾木
2020-07-07 06:57:17
Python爬取快代理
Python无忧
2020-07-05 21:50:04
Python爬取有道翻译
pigYanYan
2020-07-05 19:45:53
http常见状态码汇总
西夏之石
2020-07-05 12:32:14
partially initialized module 'requests' has no attribute 'get'解决方法
西夏之石
2020-07-05 12:32:14
decode与encode区别
西夏之石
2020-07-05 12:32:04
ProxyHandler处理器及编码学习
西夏之石
2020-07-05 12:32:04
python selenium爬取百度文库
FANtastic_Y
2020-07-05 03:45:46
【Python-爬虫】基础学习
XHDANE
2020-07-04 23:33:37
【爬虫2019,9月】携程eleven参数解密
XHDANE
2020-07-04 23:33:27