2017-09-13 5 views
2

私は、WebスクレイピングスキルのプロジェクトをまとめるためにPythonを学んでいます。フットボールの統計情報のテーブルをダウンロードするのに問題があります。私は、次のエラーを取得しています:ここでFeatureNotFound:あなたがリクエストした機能を備えたツリービルダーを見つけることができませんでした - パンダでWebスクラップする

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

は私の完全なコードです。どんな助けもありがとう。

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

[lxml](http://lxml.de/installation.html)をインストールするとよいでしょう。 – ShreyasG

答えて

2

lxmlが存在しない場合は、あなたが

pip install lxml 

ます。また、同じ効果に異なるパーサを使用することができます使用してインストールすることができます。 html.parserおよびhtml5libの両方がデフォルトで使用できます。

soup = BeautifulSoup(res.content,'html.parser') 

これは、ウェブページのスクラップの問題を解決するはずです。一度それを削ったら、プレーヤーの統計情報のテーブルのためにtable[3]をロードする必要があると思います。

関連する問題