python爬虫报错bs4.FeatureNotFound: Couldn't find a tree builder with the features you......
经过测试发现是lxml的问题,使⽤ pip install lxml 安装,安装完后,在运⾏还是⼀样出错, 经百度、知乎的说法是新的库不⽀持新版本语法,使⽤ pip install lxml时,⾃动安装的是最新 4.2.5版本
解决⽅法⼀:
卸载新的换⽼的就可以了
pip uninstall lxml
pip install lxml==3.7.0
方法二:
在报错代码中把函数参数中所有的"lxml"改成"html.parser
soup = BeautifulSoup(content, "lxml")
改成 soup = BeautifulSoup(content, "html.parse")
上一篇: 《建站管家》二次开发文档