问题描述:
在运行BeautifulSoup(html, ‘lxml’)代码时报出bs4.FeatureNotFound: Couldn’t find a tree builder with the features you requested: lxml。
方法1:
可改用BeautifulSoup(html, ‘html.parser’)运行
方法2:
如没有安装lxml库,即下载lxml库。
方法3
已有lxml库但运行依然出错。查看python文件夹libs文件夹中是否存在lxml重名文件。删除再重新下载。
方法4
已有lxml库但运行依然出错.在pycharm中删除lxml库再重新下载。