basketball_reference_web_scraper icon indicating copy to clipboard operation
basketball_reference_web_scraper copied to clipboard

Request for Uniform Number

Open dylanavery720 opened this issue 5 years ago • 3 comments

Hi @jaebradley ,

I was wondering if you had thought about adding the Uniform Number of a player to the HTTP response for season_totals. (So for Lebron James it would be {number: 23} for instance)

I think it would be very useful!

Dylan

dylanavery720 avatar Dec 07 '18 04:12 dylanavery720

@dylanavery720 this is a good idea!

So for season totals, the web page that is scraped is something like https://www.basketball-reference.com/leagues/NBA_2019_totals.html.

Because of that, I'm restricted by what's actually on the web page. Unfortunately, uniform number isn't really something that's available.

I did notice that there is a uniform numbers web page (https://www.basketball-reference.com/leagues/NBA_2019_numbers.html) but other than that I can't see or think of a suitable solution for returning uniform numbers across all players for a given season.

One thing that could be done is adding a player_information method that scrapes / parses individual player pages (like https://www.basketball-reference.com/players/j/jamesle01.html).

Hope this helps!

jaebradley avatar Dec 07 '18 04:12 jaebradley

Hey @jaebradley , jumping in here, this issue has been open for a while. Has any work been done on some sort of player_information api to pull information off of player's pages? If not, I'd like to take a swing at it. Thanks!

tomkennedy22 avatar May 01 '20 20:05 tomkennedy22

@tomkennedy22 nope, there hasn't been any work here - I've done some work to parse the player page in certain cases for the search API where basketball reference redirects to a specific player page when a single player matches a search query.

See: https://github.com/jaebradley/basketball_reference_web_scraper/blob/601fad5b0479fc0e1155470f10d8259143ebf7fd/basketball_reference_web_scraper/http_service.py#L193

Hope that provides at least a bit of a start - let me know if you have any questions!

jaebradley avatar May 02 '20 05:05 jaebradley