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