当前位置: 首页 > 工具软件 > A Tree > 使用案例 >

bs4.FeatureNotFound: Couldn't find a tree builder with the features you requested: 的解决方法

岳晟
2023-12-01

爬虫dom = BeautifulSoup(html, "lxml")  # 解析html文档时出现错误如下:

bs4.FeatureNotFound: Couldn't find a tree builder with the features you requested: lxml. Do you need。。。

错误原因:

bs4调用了python自带的html解析器,而版本python3未带有该解析器,需要重新pip下载。

解决方法:

     

pip install lxml

问题完美解决。

 类似资料: