目 录CONTENT

文章目录

UnicodeDecodeError 'utf-8' codec can't decode byte 0xe2 in position 0 invalid continuation byte

大T
2022-05-09 / 0 评论 / 0 点赞 / 70 阅读 / 0 字

UnicodeDecodeError  'utf-8' codec can't decode byte 0xe2 in position 0  invalid continuation byte

错误描述

Traceback (most recent call last):

File "D:/MyDevTools/PCrawler/crawler_demo/requests/douban_json.py", line 31, in

print(resp.content.decode())

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe2 in position 0: invalid continuation byte

进程已结束,退出代码1

image

image

引起原因

请求头带有: "accept-encoding": "gzip, deflate, br",

image

解决方法·

删掉即可。

0

评论区