basketball_reference_web_scraper icon indicating copy to clipboard operation
basketball_reference_web_scraper copied to clipboard

IndexError: list index out of range

Open Ledengary opened this issue 3 years ago • 1 comments
trafficstars

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

Ledengary avatar Sep 17 '22 22:09 Ledengary

I fixed this error by going to line 773 in html.py and replacing

'//div[@itemprop="performer"]' \ '//a[@itemprop="name"]'

with '//strong' \ '//a'

Sam-Craig avatar Sep 28 '22 02:09 Sam-Craig

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)

image

If this is indeed still an issue, feel free to reopen this issue.

jaebradley avatar Apr 06 '24 03:04 jaebradley