脚本宝典收集整理的这篇文章主要介绍了(转载)bs4.FeatureNotFound: Couldn't find a tree builder with the features you requested: html_parser.,脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。
bs4解析网页时报错:bs4.FeatureNotFound: Couldn't find a tree builder wITh the features you requested: htML_parser. Do you need to install a parser library?
原因:不可以使用 BeautifulSoup(html,'html_parser')
解决办法:
1.安装 pip install lxml
2.将BeautifulSoup(html,'html_parser') 改为BeautifulSoup(html,'lXMl')
另:好像有人遇到的情况和我的正好相反,由于刚开始接触python,还不是很了解具体原因,希望后期能够了解具体的原因。————————————————版权声明:本文为CSDN博主「西域孤狼」的原创文章,遵循CC 4.0 BY-sA版权协议,转载请附上原文出处链接及本声明。原文链接:https://blog.csdn.net/matlab001/article/details/83856642
以上是脚本宝典为你收集整理的(转载)bs4.FeatureNotFound: Couldn't find a tree builder with the features you requested: html_parser.全部内容,希望文章能够帮你解决(转载)bs4.FeatureNotFound: Couldn't find a tree builder with the features you requested: html_parser.所遇到的问题。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。