Created
April 6, 2020 08:12
-
-
Save yaojenkuo/106b0b8518e70826dc4d15e2e44b09d6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
request_url = "https://data.nba.net/10s/prod/v3/today.json" | |
request_headers = { | |
'authority': "data.nba.net", | |
'method': "GET", | |
'path': "/10s/prod/v3/today.json", | |
'scheme': "https", | |
'accept': "application/json, text/plain, */*", | |
'accept-encoding': "gzip, deflate, br", | |
'accept-language': "en,en-US", | |
'origin': "https://www.nba.com", | |
'sec-fetch-dest': "empty", | |
'sec-fetch-mode': "cors", | |
'sec-fetch-site': "cross-site", | |
'user-agent': "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36" | |
} | |
response = requests.get(request_url, headers=request_headers) | |
today_json = response.json() | |
for k, v in today_json['links'].items(): | |
print("{}: https://data.nba.net{}".format(k ,v)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment