对网站进行爬取时,发现报错:
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')
即可解决此问题