Scraping NBA.com

181 views
Skip to first unread message

Harrison Brown

unread,
Jan 7, 2015, 9:17:10 PM1/7/15
to nba...@googlegroups.com
I'm trying to scrape some shot-log data from the NBA website using Python + requests, and I'm getting an error:

requests.exceptions.ConnectionError: HTTPConnectionPool(host='stats.nba.com', port=80): Max retries exceeded with url: [insert long url here] (Caused by <class 'socket.gaierror'>: [Errno -2] Name or service not known)

Which is confusing and weird but apparently means the server is refusing my connection. Is this because it thinks I'm flooding it? If so, how long should I wait between requests? Or is it blocking me because of a no-scraping policy I'm unaware of? Any help would be appreciated.

Evan Zamir

unread,
Jan 7, 2015, 9:18:53 PM1/7/15
to Harrison Brown, nba...@googlegroups.com
Can you show the code in a gist? Hard to diagnose otherwise.



--
You received this message because you are subscribed to the Google Groups "nbawowy forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nbawowy+u...@googlegroups.com.
To post to this group, send email to nba...@googlegroups.com.
Visit this group at http://groups.google.com/group/nbawowy.
To view this discussion on the web visit https://groups.google.com/d/msgid/nbawowy/CAOw8zE8SUCCMOitRX0Nto%2BWTYJayjtF8-6B%2B%2BTTDfXb%2Bj%2B%3DEcw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Seth Partnow

unread,
Jan 7, 2015, 9:22:35 PM1/7/15
to Evan Zamir, Harrison Brown, nba...@googlegroups.com
Break it into smaller bites? I've had problems with timing out when I try to grab all the logs in one big jump, so I go by player ID (though Nick Calathes is broken)

Harrison Brown

unread,
Jan 7, 2015, 9:30:59 PM1/7/15
to Seth Partnow, Evan Zamir, nba...@googlegroups.com
Eh, it worked when I tried it a third time, I guess it was just a temporary IP block or something of that sort. Who knows.

Chase Caudill

unread,
Jan 8, 2015, 10:41:12 AM1/8/15
to Harrison Brown, Seth Partnow, Evan Zamir, nba...@googlegroups.com
I have been unable to run queries for the past 3 days, has anyone else ran into this problem? None of the names show up in the results table, it's just headings.

Thanks and Regards,



Sent from my iPhone

Evan Zamir

unread,
Jan 8, 2015, 11:16:25 AM1/8/15
to Chase Caudill, Harrison Brown, nba...@googlegroups.com, Seth Partnow
So there's been some oddities with some of the JS libraries I've been using. It's working for me intermittently if I click on a couple different teams and then run a query. If you click in the player selection boxes and see a list of players it should work, but if you don't see any players there, try clicking on another team.

Hopefully I can figure out what's really going on and fix it.



Reply all
Reply to author
Forward
0 new messages