Home > other >  Python crawler webpage
Python crawler webpage

Time:09-26

I small white one, just learn the crawler, the following problems,
First without transcoding, and then output a bunch of gibberish,
For the second time to encode and decode, then prompt wrong with GBK,
Third from the Internet query gb18030 to change into a wider range, and prompt utf-8 is out of question,
For the fourth time to use ignore ignored, finally succeeded, but otherwise all the Numbers in Chinese into the binary Numbers,
OMG, try many times all not line, which members teach me ah,

CodePudding user response:

HTML. Content. decode (' GBK ')

CodePudding user response:

reference 1/f, ice all over the sky the wind response:
HTML. The content. decode (' GBK ')

Thank you, problem solved, if you can, can you tell me why?

CodePudding user response:

refer to the second floor m0_46330963 response:
Quote: refer to 1st floor ice all over the sky the wind response:
HTML. The content. decode (' GBK ')

Thank you, problem solved, if you can, can you tell me why?

Which means that the contents of the HTML is GBK encoding output

CodePudding user response:

Encoding and decoding are need to use the same kind of coding way, HTML using the charset is what kind of, use which kinds of decoding,

CodePudding user response:

This is' GBK code
Look at the source code to know,

CodePudding user response:

You this coding and decoding of what the devil
  • Related