import requests api = 'http://site.api.espn.com/apis/site/v2/sports/baseball/mlb/scoreboard' jsonData = requests.get(api).json() events = jsonData['events'] links = [] for event in events: event_links = event['links'] for each in event_links: if each['text'] == 'Gamecast': links.append(each['href'])
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter