bs4.FeatureNotFound: Couldn't find a tree builder with the features you requested: lxml. Do you need to install a parser library?


bs4解析网页时报错:bs4.FeatureNotFound: Couldn't find a tree builder with the features you requested: lxml. Do you need to install a parser library?

原因:不可以使用 BeautifulSoup(html,'html_parser')

解决办法:

1.安装 pip install lxml

2.将BeautifulSoup(html,'html_parser') 改为BeautifulSoup(html,'lxml')


————————————————
版权声明:本文为CSDN博主「西域孤狼」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/matlab001/article/details/83856642


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM