outside-edge / python-espncricinfo

Python wrapper for the ESPNCricInfo JSON API
MIT License
144 stars 65 forks source link

[BUG] Not able to fetch player information #46

Closed bhavesh0009 closed 3 years ago

bhavesh0009 commented 3 years ago

Describe the bug player.py is not able to extract player information. It is giving error - "'NoneType' object has no attribute 'find_all'" To Reproduce Just run read me sample:

from espncricinfo.player import Player p = Player('277916') p.name

Expected behavior It should give name of player.

Screenshots image Additional context AttributeError Traceback (most recent call last)

in 1 from espncricinfo.player import Player ----> 2 p = Player('277916') 3 p.name C:\Python38\lib\site-packages\espncricinfo\player.py in __init__(self, player_id) 12 self.parsed_html = self.get_html() 13 self.json = self.get_json() ---> 14 self.player_information = self._parse_player_information() 15 self.cricinfo_id = str(player_id) 16 if self.parsed_html: C:\Python38\lib\site-packages\espncricinfo\player.py in _parse_player_information(self) 58 59 def _parse_player_information(self): ---> 60 return self.parsed_html.find_all('p', class_='ciPlayerinformationtxt') 61 62 def _name(self): AttributeError: 'NoneType' object has no attribute 'find_all'
aman0408 commented 3 years ago

Can I take this up?

kakdeykaushik commented 3 years ago

@aman0408 any updates on this ?

W-Booth commented 3 years ago

@dwillis @aman0408 Friendly bump

dwillis commented 3 years ago

I've pushed a fix for this - it removes some of the methods that depend on HTML parsing for now but the Player object remains mostly intact.