예제 #1
0
def get_totals():
    url = 'https://classic.sportsbookreview.com/betting-odds/nhl-hockey/totals/'
    game_days = get_games(url)

    totals = []

    for game_day in game_days:
        game_date = get_game_date(game_day)
        if game_date:
            games = game_day.find_all(
                'div', attrs={'class': 'event-holder holder-scheduled'})

            for game in games:
                teams = get_game_info(game)
                game_info = f'{teams} {game_date}'
                total = gt.totals(game)
                if total:
                    # check that lines aren't empty
                    line = {
                        'game': game_info,
                        'overs': total[0],
                        'unders': total[1]
                    }
                    totals.append(line)

    return totals
예제 #2
0
파일: not_football.py 프로젝트: JoshNas/Arb
def get_totals(url, sport):
    game_days = get_games(url, sport)

    totals = []

    for game_day in game_days:
        game_date = get_game_date(game_day)
        if game_date:
            games = game_day.find_all(
                'div', attrs={'class': 'event-holder holder-scheduled'})

            for game in games:
                teams = get_game_info(game)
                game_info = f'{teams} {game_date}'
                total = gt.totals(game)
                if total:
                    # check that lines aren't empty
                    line = {
                        'game': game_info,
                        'overs': total[0],
                        'unders': total[1]
                    }
                    totals.append(line)

    return totals
예제 #3
0
def get_totals(url):
    games = get_games(url)
    totals = []

    for game in games:
        away_team, home_team = get_teams(game)
        if away_team:
            total = gt.totals(game)
            if total:
                line = {'game': f'{away_team} vs {home_team}', 'overs': total[0], 'unders': total[1]}
                totals.append(line)
    return totals