liquipediapy
liquipediapy copied to clipboard
dota2 get_upcoming_and_ongoing_games
for match in matches:
game = {}
cells = match.find_all('td')
try:
game['team1'] = cells[0].find('span',class_='team-template-image').find('a').get('title')
game['format'] = cells[1].find('abbr').get_text()
game['team2'] = cells[2].find('span',class_='team-template-image').find('a').get('title')
game['start_time'] = cells[3].find('span',class_="timer-object").get_text()
game['tournament'] = cells[3].find('div').get_text().rstrip()
try:
game['twitch_channel'] = cells[3].find('span',class_="timer-object").get('data-stream-twitch')
except AttributeError:
pass
games.append(game)
except AttributeError:
continue
get team name class has changed “team-template-image-icon”