当服务器的内容类型是"Content-Type:text/html"时.requests.get()返回不正确编码的数据.就好像我们将内容类型明确地称为'Content-Type:text/html; charset = utf-8',它返回正确的数据.
当我们使用urllib.urlopen()时,它返回正确的数据.以前有人注意到了吗?为什么requests.get()表现得像这样?
python utf-8
python ×1
utf-8 ×1