Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Couldn't find a tree builder with the features you requested: html5lib. Do you need to install a parser library?

I try to use soup4 with my python3.5 ,but evrey time i rule a code to extrac something from internet i get this error :

 - 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?

There was a link with the same error in this site bs4.FeatureNotFound: Couldn't find a tree builder with the features you requested: lxml. Do you need to install a parser library? I tried all , still get the error

All the pip install requests pip install lxml pip install beautifull soup4

I download soup4 https://www.crummy.com/software/BeautifulSoup/bs4/download/4.6/ manual an install it setup.py install

I have all updated and working , but still i get the error plz help me

like image 208
user10451243 Avatar asked Dec 14 '18 21:12

user10451243


People also ask

How do I import LXML into Python?

Type “ pip install lxml ” (without quotes) in the command line and hit Enter again. This installs lxml for your default Python installation. The previous command may not work if you have both Python versions 2 and 3 on your computer. In this case, try "pip3 install lxml" or “ python -m pip install lxml “.


1 Answers

If you are using html5lib as an underlying parser:

soup = BeautifulSoup(html, "html5lib")
#                            ^HERE^

Then, you need to have html5lib module installed in your python environment:

pip install html5lib

Documentation reference: Installing a parser.

like image 131
alecxe Avatar answered Oct 04 '22 22:10

alecxe