nickpadd / EuropeanFootballLeaguePredictor

A machine learning/statistical model to derive prediction probabilities for football matches of the top european leagues.
https://nickpadd.github.io/EFLP.github.io/Home/
MIT License
15 stars 3 forks source link

Updated bookmaker website created a bug in bookmaker_scraper.py #61

Closed nickpadd closed 5 months ago

nickpadd commented 5 months ago
2024-02-07 15:46:11.120 | ERROR    | __main__:main:41 - An error has been caught in function 'main', process 'MainProcess' (56811), thread 'MainThread' (140513298853952):
Traceback (most recent call last):

  File "/home/nickpad/Documents/EuropeanFootballLeaguePredictor/run_updates.py", line 81, in <module>
    main()
    └ <function main at 0x7fcbbf6ee9d0>

> File "/home/nickpad/Documents/EuropeanFootballLeaguePredictor/run_updates.py", line 41, in main
    odds_dataframe = bookmaker_scraper.get_odds()
                     │                 └ <function BookmakerScraper.get_odds at 0x7fcb9e211ca0>
                     └ <europeanfootballleaguepredictor.data.bookmaker_scraper.BookmakerScraper object at 0x7fcb9d327b80>

  File "/home/nickpad/Documents/EuropeanFootballLeaguePredictor/europeanfootballleaguepredictor/data/bookmaker_scraper.py", line 101, in get_odds
    odds_dataframe = self.odds_json_to_dataframe(odds_json)
                     │    │                      └ {'data': {'leagueStandings': [], 'leagueGrouping': True, 'sport': {'id': 'FOOT', 'name': 'Soccer', 'region': 'England', 'url'...
                     │    └ <function BookmakerScraper.odds_json_to_dataframe at 0x7fcb9e211c10>
                     └ <europeanfootballleaguepredictor.data.bookmaker_scraper.BookmakerScraper object at 0x7fcb9d327b80>

  File "/home/nickpad/Documents/EuropeanFootballLeaguePredictor/europeanfootballleaguepredictor/data/bookmaker_scraper.py", line 80, in odds_json_to_dataframe
    line = names[4].split(' ')[1]
           └ ['1', 'X', '2']

IndexError: list index out of range
nickpadd commented 5 months ago

Over and Under odds do not appear in the main page after the update