UnicodeDecodeError: 'gbk' codec can't decode byte 0xbf in position 350: illegal multibyte sequence

ret = requests.get(url)
#print(ret.text)
ret = ret.content.decode("gbk")

报错

UnicodeDecodeError: 'gbk' codec can't decode byte 0xbf in position 350: illegal multibyte sequence

解决:

ret = requests.get(url)
#print(ret.text)
ret = ret.content.decode()
posted @ 2023-03-14 20:08  腹肌猿  阅读(35)  评论(0编辑  收藏  举报