outside-edge / python-espncricinfo

Python wrapper for the ESPNCricInfo JSON API
MIT License
146 stars 64 forks source link

[BUG] Player class is not working with Python 3.11.0 #59

Closed RavinderSingh13-git closed 8 months ago

RavinderSingh13-git commented 1 year ago

Describe the bug When I am using from espncricinfo.player import Player and trying to execute p = Player('277916') its giving me an error.

To Reproduce Gives me following error:

>>> p = Player('277916')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\Singh\Desktop\Alexa Automation\.venv\Lib\site-packages\espncricinfo\player.py", line 14, in __init__
    self.player_information = self._parse_player_information()
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Singh\Desktop\Alexa Automation\.venv\Lib\site-packages\espncricinfo\player.py", line 60, in _parse_player_information
    return self.parsed_html.find_all('p', class_='ciPlayerinformationtxt')
           ^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'find_all'

Expected behavior It should give player information.

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

Additional context Add any other context about the problem here.

YusiferZendric commented 1 year ago

Same error please look into it.

YusiferZendric commented 1 year ago

I've found a temporary solution Remove the self.major_teams and _major_teams function or comment them out it should work

JackMa222 commented 8 months ago

I have written a PR to attempt to fix this #62