Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[BUG] Not able to fetch player information #46

Closed
bhavesh0009 opened this issue Apr 18, 2021 · 4 comments
Closed

[BUG] Not able to fetch player information #46

bhavesh0009 opened this issue Apr 18, 2021 · 4 comments
Assignees

Comments

@bhavesh0009
Copy link

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
Copy link

Can I take this up?

@kakdeykaushik
Copy link

@aman0408 any updates on this ?

@W-Booth
Copy link

W-Booth commented Jun 14, 2021

@dwillis @aman0408 Friendly bump

@dwillis dwillis closed this as completed in 436dce9 Jul 5, 2021
@dwillis
Copy link
Collaborator

dwillis commented Jul 5, 2021

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.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants