爬取时出现报错 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

原文地址:https://www.cnblogs.com/profesor/p/15212035.html