FeatureNotFound: Couldn't find a tree builder with the features you requested – Webscraping with Pandas
10,231
If lxml
does not exist, you can install it using
pip install lxml
You could also use a different parser to the same effect. html.parser
and html5lib
are both available by default.
soup = BeautifulSoup(res.content,'html.parser')
This should solve the issue of scraping the webpage. Once you've scraped it, I think you'll need to load table[3]
, for the table of player stats.
Author by
Clay
Updated on June 04, 2022Comments
-
Clay almost 2 years
I am learning Python to put together a project for web-scraping skills. I am having trouble downloading a table for football statistics. I am getting the following error:
FeatureNotFound: Couldn't find a tree builder with the features you requested: lxml. Do you need to install a parser library?
Here is my full code. Any help great appreciated.
import pandas as pd import requests from bs4 import BeautifulSoup res = requests.get("http://www.fftoday.com/stats/playerstats.php?Season=2002&GameWeek=1&PosID=10&LeagueID=26955") soup = BeautifulSoup(res.content,'lxml') table = soup.find_all('table')[1] Traceback (most recent call last): File "<ipython-input-20-e6d65d59d7e8>", line 6, in <module> soup = BeautifulSoup(res.content,'lxml') File "C:\Users\Unciv\Anaconda3\envs\ML27\lib\site-packages\bs4\__init__.py", line 165, in __init__ % ",".join(features)) FeatureNotFound: Couldn't find a tree builder with the features you requested: lxml. Do you need to install a parser library?
-
ShreyasG over 6 yearsYou might want to install lxml
-