sportsipy
sportsipy copied to clipboard
NCAAB Boxscore no longer working
Hello, as of yesterday afternoon (Mar-14), the sportsipy.ncaab.boxscore module stopped working as expected. It appears this may be due to a change in the sports reference site (just in time for march madness...sigh).
Boxscore('2021-01-02-14-hofstra')
`---------------------------------------------------------------------------
IndexError Traceback (most recent call last)
~/opt/anaconda3/lib/python3.7/site-packages/sportsipy/ncaab/boxscore.py in init(self, uri) 223 self._home_defensive_rating = None 224 --> 225 self._parse_game_data(uri) 226 227 def str(self):
~/opt/anaconda3/lib/python3.7/site-packages/sportsipy/ncaab/boxscore.py in _parse_game_data(self, uri)
681 if short_field == 'away_record' or
682 short_field == 'home_record':
--> 683 value = self._parse_record(short_field, boxscore, index)
684 setattr(self, field, value)
685 continue
~/opt/anaconda3/lib/python3.7/site-packages/sportsipy/ncaab/boxscore.py in _parse_record(self, field, boxscore, index) 388 records = boxscore(BOXSCORE_SCHEME[field]).items() 389 records = [x.text() for x in records if x.text() != ''] --> 390 return records[index] 391 392 def _find_boxscore_tables(self, boxscore):
IndexError: list index out of range`
I've found the same issue. It appears to be specific to 2020-21 games, but not sure why.
i am not confident in my coding ability enough to fix or make changes to the main branch, but concerned that this is broken while demand must be high during march madness...anyone have suggestions for workarounds / quick fixes?
Seems like this might be a duplicate of #591 and there are some suggestions in there. I've created #598 to try and resolve it but not sure what it'll take to get that merged. You should be able to install my fix directly with pip:
pip install "git+git://github.com/alexwisswolf/sportsipy@fix-ncaab-boxscore"
Or add git+git://github.com/alexwisswolf/sportsipy@fix-ncaab-boxscore
to your requirements.txt
to test it out. If you do, me know if if works for you!