I am attempting to scrape data from NBA.com using Python, but I do not receive a response after waiting for a reasonable amount of time when I run my code (shown below).
import requests
import json
url_front = 'http://stats.nba.com/stats/leaguedashplayerstats?College=&' + \
'Conference=&Country=&DateFrom=&DateTo=&Division=&DraftPick=&' + \
'DraftYear=&GameScope=&GameSegment=&Height=&LastNGames=0&LeagueID=00&' + \
'Location=&MeasureType='
url_back = '&Month=0&OpponentTeamID=0&Outcome=&PORound=0&PaceAdjust=N&' + \
'PerMode=PerGame&Period=0&PlayerExperience=&PlayerPosition=&' + \
'PlusMinus=N&Rank=N&Season=2016-17&SeasonSegment=&' + \
'SeasonType=Regular+Season&ShotClockRange=&StarterBench=&TeamID=0&' + \
'VsConference=&VsDivision=&Weight='
#measure_type = ['Base','Advanced','Misc','Scoring','Opponent','Usage','Defense']
measure_type = 'Base'
address = url_front + measure_type + url_back
# Request the URL, then parse the JSON.
response = requests.get(address)
response.raise_for_status() # Raise exception if invalid response.
data = response.json() # JSON decoding.
So far, I have attempted to reproduce code from blog posts (here) and/or questions posted on this site (Python, R) that are similar in nature, but I end up with the same result each time - the code does not actually succeed in pulling anything from the URL.
Since I am new to web scraping, I was hoping for assistance with troubleshooting the issue - is this common to sites with client-side rendering (NBA.com), or is it indicative of an issue with my code/computer? In either case, are there common workarounds/solutions?