ValueError: Unicode strings with encoding declaration are not supported.
在写爬虫爬取网页时遇到题目中的问题,完整错误如下:def getXpath(req, xpath): sourcehtml = etree.HTML(req.text) print(sourcehtml) nodes = sourcehtml.xpath(xpath) return nodesValueError:Unicodestringswithencodingdeclarationarenotsupported.Pleaseusebyt...
原创
2020-06-26 20:11:21 ·
5219 阅读 ·
0 评论