UnicodeDecodeError: ‘utf-8‘ codec can‘t decode byte 0xb3 in position 爬虫报错
UnicodeDecodeError: ‘utf-8’ codec can’t decode byte 0xb3 in position
爬虫 print(response.read().decode(“utf-8”))报错信息
和讯网用gb18030编码
import urllib.request
import urllib.parse
#把请求对象包装成浏览器
url = “http://stockdata.stock.hexun.com/zrbg/”
headers = {
“User-Agent”:
原创
2021-03-28 16:49:46 ·
234 阅读 ·
0 评论