python3 requests请求response.text返回\u 16进制数字,转换中文.

返回\u 16进制数字

reponse.content.decode("unicode_escape")

返回乱码中文

获取网站原始编码
print(requests.utils.get_encodings_from_content(r.text)[0])
设置编码: r.encoding= requests.utils.get_encodings_from_content(r.text)[0]
打印: print(r.text)

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章