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

解决:Couldn‘t find a tree builder with the features you requested: lxml.parser

姬烨磊
2023-12-01

使用soup = BeautifulSoup(html.text, ‘lxml’)

对网站进行爬取时,发现报错:
At this point either we have a TreeBuilder instance in FeatureNotFound: Couldn't find a tree builder with the features you requested: lxml.parser. Do you need to install a parser library?
查看pip list查看lxml的版本
为最新版本
lxml 4.6.3
soup = BeautifulSoup(html.text, 'lxml')改为:
soup = BeautifulSoup(html.text, 'html.parser')
即可解决此问题

 类似资料: