roclark / sportsipy

A free sports API written for python
MIT License
475 stars 189 forks source link

NHL Boxscore error #763

Open zwag20 opened 1 year ago

zwag20 commented 1 year ago

Describe the bug When I run the dataframe on an nhl boxscore I get the following error:

Traceback (most recent call last): File "", line 1, in File "C:\Users\myuser\Miniconda3\lib\site-packages\sportsipy\nhl\boxscore.py", line 723, in dataframe 'losing_abbr': self.losing_abbr, File "C:\Users\myuser\Miniconda3\lib\site-packages\sportsipy\nhl\boxscore.py", line 840, in losing_abbr return utils._parse_abbreviation(self._away_name) File "C:\Users\myuser\Miniconda3\lib\site-packages\sportsipy\utils.py", line 151, in _parse_abbreviation abbr = re.sub(r'/[0-9]+..htm.', '', uri_link('a').attr('href')) File "C:\Users\myuser\Miniconda3\lib\re.py", line 210, in sub return _compile(pattern, flags).sub(repl, string, count) TypeError: expected string or bytes-like object

To Reproduce Sample code which causes an issue.

from sportsipy.nhl.boxscore import Boxscore
game = Boxscore('202210120CAR')
game.dataframe

Expected behavior A Dataframe should be populated

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):