detect

2024/9/2 13:12:21

Python爬虫解决中文乱码

目录 一、中文乱码 二、chardet.detect()解决 三、在页面查找编码格式解决 一、中文乱码 问题在于文本的编码格式不正确 import requestsurlhttps://www.shicimingju.com/book/sanguoyanyi.html headers{User-Agent:Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKi…