basketball_reference_web_scraper
basketball_reference_web_scraper copied to clipboard
IndexError: list index out of range
Hello,
I am trying to run the example you have provided for the play_by_play method:
==================================================================== from basketball_reference_web_scraper import client from basketball_reference_web_scraper.data import OutputType, Team
client.play_by_play(home_team=Team.BOSTON_CELTICS, year=2018, month=10, day=16)
but I get the following error:
2 frames /usr/local/lib/python3.7/dist-packages/basketball_reference_web_scraper/client.py in play_by_play(home_team, day, month, year, output_type, output_file_path, output_write_option, json_options)
/usr/local/lib/python3.7/dist-packages/basketball_reference_web_scraper/http_service.py in play_by_play(self, home_team, day, month, year)
/usr/local/lib/python3.7/dist-packages/basketball_reference_web_scraper/html.py in away_team_name(self)
IndexError: list index out of range
I fixed this error by going to line 773 in html.py and replacing
'//div[@itemprop="performer"]' \
'//a[@itemprop="name"]'
with
'//strong' \
'//a'
Apologies for the delayed reply, but I do not think this is an issue any more. Please see [this repl.it].(https://replit.com/@jaebradley/Issue-234#main.py)
If this is indeed still an issue, feel free to reopen this issue.