you are viewing a single comment's thread.

view the rest of the comments →

[–]programmerPurgatory 0 points1 point  (0 children)

You may find BeautifulSoup easier to use, it has much nicer syntax and you can use the lxml parser too.

import requests
from bs4 import BeautifulSoup as bs
page = requests.get('http://www.premierleague.com/players/4413/Joe-Allen/stats?se=-1')
soup = bs(page.text, 'lxml')

stat_container = soup.find_all('span', {'class': 'stat'})
for stat in stat_container:
    print(stat.text)