Problem with lxml parser

158 views
Skip to first unread message

Дмитрий Скороходов

unread,
Mar 21, 2023, 5:50:53 AM3/21/23
to beautifulsoup
Hello,

Trying to do parsing :
import requests


url = "https://www.swedbank.lv/private/d2d/payments/rates/currency?language=RUS"
r = requests.get(url)
print(r.text)


from bs4 import BeautifulSoup
soup = BeautifulSoup(r.text, 'lxml')
print(soup)
But keep getting error : 

__init__
    raise FeatureNotFound(
bs4.FeatureNotFound: Couldn't find a tree builder with the features you requested: lxml. Do you need to install a parser library?

I did installation of lxml :

 pip install html5lib
Collecting html5lib
  Downloading html5lib-1.1-py2.py3-none-any.whl (112 kB)
    112.2/112.2 kB ? eta 0:00:00
Collecting six>=1.9
  Using cached six-1.16.0-py2.py3-none-any.whl (11 kB)
Collecting webencodings
  Downloading webencodings-0.5.1-py2.py3-none-any.whl (11 kB)
Installing collected packages: webencodings, six, html5lib
Successfully installed html5lib-1.1 six-1.16.0 webencodings-0.5.1


How can I fix this error?. Already spend 2 days looking for an anwer.

leonardr

unread,
Mar 21, 2023, 6:55:53 AM3/21/23
to beautifulsoup
bs4.FeatureNotFound: Couldn't find a tree builder with the features you requested: lxml. Do you need to install a parser library?

I did installation of lxml :

 pip install html5lib

This command is to install the html5lib library, not the lxml library. Try running this command instead to install the lxml library:

pip install lxml

Leonard
Reply all
Reply to author
Forward
0 new messages