UnicodeDecodeError: ‘utf-8‘ codec can‘t decode byte 0xca in position 358: in
爬虫遇到的问题,UnicodeDecodeError: 'utf-8' codec can't decode byte 0xca in position 358: inhtml = response.read().decode('utf-8')然后报错,出现该报错第一反应就是代码的编码问题,将utf-8改为gbk还是报错。解决方法:打开相应网站的页面按F12查看页面信息,看网站的编码是啥,然后填写对应的就行了html = response.read().decode('gb2312'
原创
2021-03-25 15:18:36 ·
729 阅读 ·
0 评论