Python requests 中文编码问题
2020-01-15 本文已影响0人
夙小叶
ID=75209738
# import requests as rqt
try:
decode_html = html.text.encode\
("ISO-8859-1").decode(html.apparent_encoding)
except UnicodeDecodeError:
decode_html = html.text.encode("ISO-8859-1").decode\
(rqt.utils.get_encodings_from_content(html.text)[0])
