def load_stats_tables_from_history_page(url):
"""Load all the prediction tables from a Numberfire history page"""
soup = getSoupFromURL(url)
#salary = load_player_salary_table(soup)
projection_months = ['%s-schedule' % month for month in
['March', 'April', 'May', 'June', 'July', 'August', 'September', 'October']]
month_tables = []
for month in projection_months:
month_schedule = soup.find('div', attrs={'id': month})
month_table = load_player_history_table(month_schedule)
if month_table is not None:
month_tables.append(month_table)
if month_tables:
all_predictions = pandas.concat(month_tables)
all_predictions.sort_index(inplace=True)
if all_predictions.index.duplicated().any():
print 'Duplicate games scraped!'
import IPython
IPython.embed()
else:
all_predictions = None
return all_predictions
评论列表
文章目录