我尝试在我的python3.5中使用soup4,但是每次我都规定了一个代码来从互联网上提取一些东西,我收到了这个错误:
- s4\__init__.py", line 198, in __init__
% ",".join(features)) bs4.FeatureNotFound: Couldn't find a tree builder with the features you requested: html5lib. Do you need to install a parser library?
本站有一个同样错误的链接 bs4.FeatureNotFound: Couldn't find a tree builder with the features you requested: lxml. Do you need to install a parser library?
都试过了,还是报错
所有 pip 安装请求
pip 安装 lxml
pip安装 BeautifulSoup 4
我下载soup4 https://www.crummy.com/software/BeautifulSoup/bs4/download/4.6/ 手册并安装它 setup.py install
我已经全部更新和工作,但我仍然收到错误请帮助我
最佳答案
如果您使用 html5lib
作为底层解析器:
soup = BeautifulSoup(html, "html5lib")
# ^HERE^
然后,您需要在 python 环境中安装
html5lib
模块:pip install html5lib
文档引用: Installing a parser 。