标签:family 技术分享 width lan nic 检查 img span 类型
在爬虫中经常会碰到爬取结果输出为中文,以下为解决办法:
先检查输出text的类型:
若type(text)为str,则
text.decode(‘unicode_escape‘)
若type(text)为bytes,则
text.encode(‘latin-1‘).decode(‘unicode_escape‘)
标签:family 技术分享 width lan nic 检查 img span 类型
原文地址:https://www.cnblogs.com/s-p-l/p/10290199.html