I just wanted to post an other approach, so you don't have to use 6 different lists to store connected data. Additionally there is a shorter and more elegant way of getting all intended rows.
# getting data
#...
from bs4 import BeautifulSoup
from collections import namedtuple
soup = BeautifulSoup(data)
# thats where the data are collected
rows = list()
# named tuple to store the relevant data of one player
Player = namedtuple('Player', ['name', 'team', 'goals', 'assists', 'points'])
# getting every row of the tbody in the specified table
for tr in soup.select('table.data.stats tbody tr'):
# put text-contents of the row in a list
cellStrings = [cell.find(text = True) for cell in tr.findAll('td')]
# add it to the
rows.append(
Player(
name=cellStrings[1],
team=cellStrings[2],
goals=cellStrings[5],
assists=cellStrings[6],
points=cellStrings[7]
)
)
rows
looks like that
[Player(name=u'Steven Stamkos', team=u'TBL', goals=u'14', assists=u'9', points=u'23'),
Player(name=u'Sidney Crosby', team=u'PIT', goals=u'8', assists=u'15', points=u'23'),
Player(name=u'Ryan Getzlaf', team=u'ANA', goals=u'10', assists=u'12', points=u'22'),
Player(name=u'Alexander Steen', team=u'STL', goals=u'14', assists=u'7', points=u'21'),
Player(name=u'Corey Perry', team=u'ANA', goals=u'11', assists=u'10', points=u'21'),
Player(name=u'Alex Ovechkin', team=u'WSH', goals=u'13', assists=u'7', points=u'20'),
....
Access like that
>>> rows[20].name
u'Bryan Little'