Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Player Search returns ValueError Unknown league abbreviation #184

Closed
nycdubliner opened this issue May 16, 2020 · 2 comments · Fixed by #191
Closed

Player Search returns ValueError Unknown league abbreviation #184

nycdubliner opened this issue May 16, 2020 · 2 comments · Fixed by #191
Assignees
Labels

Comments

@nycdubliner
Copy link

Some players trigger "ValueError: Unknown league abbreviation: None"

Reproduction instructions:
from basketball_reference_web_scraper import client
client.search(term="Alonzo Mourning")

Also happens for :
client.search(term="Dominique Wilkins")
client.search(term="Rick Barry")
(But these have no years within your supported range of years.)

Thanks you for doing the work to give us this tool.
I really appreciate it.
T.

@jaebradley
Copy link
Owner

Yikes - sorry about this. Am looking into this issue.

@jaebradley jaebradley self-assigned this May 23, 2020
@jaebradley jaebradley added the bug label May 23, 2020
jaebradley added a commit that referenced this issue Jun 4, 2020
…a given season (#191)

Resolves #184 

In each of the cases mentioned on the issue, the player did not participate for a given season.

In Alonzo Mourning's case it was due to illness

<img width="1162" alt="image" src="https://user-images.githubusercontent.com/8136030/83691823-d55a7300-a5c0-11ea-928b-e9c0311c880d.png">

In Dominique Wilkins' case it was due to playing in other professional leagues

<img width="1067" alt="image" src="https://user-images.githubusercontent.com/8136030/83691854-e60ae900-a5c0-11ea-8f5b-ecc1a0478772.png">

And in Rick Barry's case it was for legal reasons

<img width="1111" alt="image" src="https://user-images.githubusercontent.com/8136030/83691927-0175f400-a5c1-11ea-9b25-1670b5fa6d83.png">

So when parsing leagues from a player's page (when search redirects to player's page when they are only matching result) check to see if league is `None`.
@jaebradley
Copy link
Owner

@nycdubliner sorry for the delay in getting back to you - this should be resolved in 4.9.3.

See this repl.it example: https://repl.it/@jaebradley/Search-For-Players-That-Missed-Seasons#main.py

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants