def parse_game_row(game_row):
'NYM - N. Syndergaard (4-5, 3.05)'
home_cell = game_row.find('td', {'class': 'shsNamD shsProbHome'})
away_cell = game_row.find('td', {'class': 'shsNamD shsProbAway'})
home_match = pitcher_re.search(home_cell.text)
away_match = pitcher_re.search(away_cell.text)
if not home_match or not away_match:
print 'Problem with RE matching!'
import IPython
IPython.embed()
home_groups = home_match.groupdict()
away_groups = away_match.groupdict()
home_team = fix_team(home_groups['team'])
away_team = fix_team(away_groups['team'])
# Return teams, projected starters, @ if away, and opponents
team_rows = [[home_team, home_groups['starter'], None, away_team],
[away_team, away_groups['starter'], '@', home_team]]
return team_rows
评论列表
文章目录