Python 解析网页乱码(BeautifulSoup解析网页乱码) 北京华利å解决方法

xiaoxiao2025-07-12  8

方法一 : 打印时转换编码: entName=标签.get_text() #获取文本 entName.encode('latin1').decode('utf-8')  

方法二:

Soup = BeautifulSoup(html.text.encode(html.encoding), 'lxml', from_encoding='utf-8')

正常打印即可

 

转载请注明原文地址: https://www.6miu.com/read-5032974.html

最新回复(0)