from urllib.request import urlopen, urlcleanup, Request
url =" http://tech.qq.com/a/20181210."
request = Request (url)
response = urlopen (request)
content = response.read (). Decode ("gb2312")
urlcleanup ()
appears:
UnicodeDecodeError: "gb2312" codec can"t decode byte 0x8b in position 1: illegal multibyte sequence
how to solve this problem? I read a lot of materials on the Internet, all related to the request header
""Accept-Encoding":" gzip, deflate"", but to no avail.
Please help solve the problem ~
Thank you!