爬取时出现报错 encoding error : input conversion failed due to input error, bytes 0xAC 0x4E 0x00 0x00

 

爬当当的时候遇到的encoding error : input conversion failed due to input error, bytes 0xAC 0x4E 0x00 0x00

原因是bs4解析dom时会读取html的

<meta http-equiv="Content-Type" content="text/html; charset=GB2312">

可能这时输入的已经是解码的字符串,而编码不一定对,可以删除这行或者直接给二进制字符串

 

来源:https://www.jianshu.com/p/0fa238c6615d

posted @ 2021-08-31 20:16  profesor  阅读(759)  评论(0编辑  收藏  举报