Exporting Data from nba.com/stats

Moderator: Doctor MJ

User avatar
ijspeelman
Forum Mod - Cavs
Forum Mod - Cavs
Posts: 1,728
And1: 859
Joined: Feb 17, 2022
Contact:
   

Exporting Data from nba.com/stats 

Post#1 » by ijspeelman » Wed Mar 22, 2023 9:28 pm

Howdy all,

Does anyone know how to export data via data tab > from web on excel. Whenever I attempt to do it, the table will not show up.

I'd like to be able to keep current stats in Excel so I do not have to manually copy and paste the tables each time.

If anyone knows how to do this or has a different way, please let me know.
jasonxxx102
Veteran
Posts: 2,635
And1: 2,723
Joined: Feb 13, 2014

Re: Exporting Data from nba.com/stats 

Post#2 » by jasonxxx102 » Mon Mar 27, 2023 9:55 am

You can f12, inspect element, copy element. And it will copy it in table format and it’s easy to paste into excel.

There are plenty of other sites that already have it tho and have exports if you’re looking for something specific
User avatar
ijspeelman
Forum Mod - Cavs
Forum Mod - Cavs
Posts: 1,728
And1: 859
Joined: Feb 17, 2022
Contact:
   

Re: Exporting Data from nba.com/stats 

Post#3 » by ijspeelman » Mon Mar 27, 2023 2:31 pm

jasonxxx102 wrote:You can f12, inspect element, copy element. And it will copy it in table format and it’s easy to paste into excel.

There are plenty of other sites that already have it tho and have exports if you’re looking for something specific


I really want to be able to have a copies of these tables in excel that can update easily so I don't have to re-copy and paste each time I need updated data.
jasonxxx102
Veteran
Posts: 2,635
And1: 2,723
Joined: Feb 13, 2014

Re: Exporting Data from nba.com/stats 

Post#4 » by jasonxxx102 » Tue Mar 28, 2023 12:44 am

ijspeelman wrote:
jasonxxx102 wrote:You can f12, inspect element, copy element. And it will copy it in table format and it’s easy to paste into excel.

There are plenty of other sites that already have it tho and have exports if you’re looking for something specific


I really want to be able to have a copies of these tables in excel that can update easily so I don't have to re-copy and paste each time I need updated data.


Without using python I don’t believe there’s a way to do what you’re wanting to do
User avatar
ijspeelman
Forum Mod - Cavs
Forum Mod - Cavs
Posts: 1,728
And1: 859
Joined: Feb 17, 2022
Contact:
   

Re: Exporting Data from nba.com/stats 

Post#5 » by ijspeelman » Tue Mar 28, 2023 1:47 am

jasonxxx102 wrote:
ijspeelman wrote:
jasonxxx102 wrote:You can f12, inspect element, copy element. And it will copy it in table format and it’s easy to paste into excel.

There are plenty of other sites that already have it tho and have exports if you’re looking for something specific


I really want to be able to have a copies of these tables in excel that can update easily so I don't have to re-copy and paste each time I need updated data.


Without using python I don’t believe there’s a way to do what you’re wanting to do


I found a good video on potential python options (https://youtu.be/nHtlRlWmTV4), but it looks like NBA blocks some of their more advanced statistics from his method as well. He does mention in the comments that there are other methods to accessing those as well, but its more complicated.

Guess its time to hunker down and learn python.
jasonxxx102
Veteran
Posts: 2,635
And1: 2,723
Joined: Feb 13, 2014

Re: Exporting Data from nba.com/stats 

Post#6 » by jasonxxx102 » Tue Mar 28, 2023 10:03 am

ijspeelman wrote:
jasonxxx102 wrote:
ijspeelman wrote:
I really want to be able to have a copies of these tables in excel that can update easily so I don't have to re-copy and paste each time I need updated data.


Without using python I don’t believe there’s a way to do what you’re wanting to do


I found a good video on potential python options (https://youtu.be/nHtlRlWmTV4), but it looks like NBA blocks some of their more advanced statistics from his method as well. He does mention in the comments that there are other methods to accessing those as well, but its more complicated.

Guess its time to hunker down and learn python.


The way to get around whatever NBA is blocking is to use python with selenium. That way you can emulate a user and spin up a browser instance directly so the site can’t tell that you’re using a script.

Try and use chat gpt to build a framework and tweak it as you see fit
jasonxxx102
Veteran
Posts: 2,635
And1: 2,723
Joined: Feb 13, 2014

Re: Exporting Data from nba.com/stats 

Post#7 » by jasonxxx102 » Tue Mar 28, 2023 11:32 am

ijspeelman wrote:
jasonxxx102 wrote:
ijspeelman wrote:
I really want to be able to have a copies of these tables in excel that can update easily so I don't have to re-copy and paste each time I need updated data.


Without using python I don’t believe there’s a way to do what you’re wanting to do


I found a good video on potential python options (https://youtu.be/nHtlRlWmTV4), but it looks like NBA blocks some of their more advanced statistics from his method as well. He does mention in the comments that there are other methods to accessing those as well, but its more complicated.

Guess its time to hunker down and learn python.


If you need any help feel free to reach out. I've done a bunch in python, a few different kinds of web scrapers and I have experience with selenium as well in both python and c#
User avatar
WestGOAT
Starter
Posts: 2,453
And1: 3,287
Joined: Dec 20, 2015

Re: Exporting Data from nba.com/stats 

Post#8 » by WestGOAT » Mon Aug 21, 2023 3:29 pm

ijspeelman wrote:
jasonxxx102 wrote:
ijspeelman wrote:
I really want to be able to have a copies of these tables in excel that can update easily so I don't have to re-copy and paste each time I need updated data.


Without using python I don’t believe there’s a way to do what you’re wanting to do


I found a good video on potential python options (https://youtu.be/nHtlRlWmTV4), but it looks like NBA blocks some of their more advanced statistics from his method as well. He does mention in the comments that there are other methods to accessing those as well, but its more complicated.

Guess its time to hunker down and learn python.


If you are looking to collect similar data as what you can find on pbpstats.com using Python have a look at this github:
https://github.com/dblackrun/pbpstats

Basically contains the python code you need to collect this type of data, and could be a nice resource/gateway to learn Python.
Image
spotted in Bologna

Return to Statistical Analysis