encoding error : input conversion failed due to input error, bytes 0xAC 0x4E 0x00 0x00

created at 09-01-2021 views: 4

error

Encoding error encountered when climbing Dangdang: input conversion failed due to input error, bytes 0xAC 0x4E 0x00 0x00

reason and solution

The reason is that bs4 will read html when parsing dom

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

Maybe the input is already a decoded string, and the encoding is not necessarily correct, you can delete this line or directly give the binary string

created at:09-01-2021
edited at: 09-01-2021: