解决如下:
éç»äººè¡¨ç®çé¿å ååè¶(æå 如果存在这些特殊字符 有可能encode失败
response = requests.get(url)
response.encoding = response.apparent_encoding # 将乱码进行编码
html = etree.HTML(response.text) # 正常 Unicode
éç»äººè¡¨ç®çé¿å ååè¶(æå 如果存在这些特殊字符 有可能encode失败
response = requests.get(url)
response.encoding = response.apparent_encoding # 将乱码进行编码
html = etree.HTML(response.text) # 正常 Unicode