Created
May 21, 2019 22:57
-
-
Save DavidLutton/85653f3e4d0583c812f2ac97093727ce to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
# from pathlib import Path | |
from pprint import pprint | |
road = 'A1' | |
url = f'http://www.trafficengland.com/api/events/getByRoad?road={road}&events=CONGESTION,INCIDENT,ROADWORKS,MAJOR_ORGANISED_EVENTS,ABNORMAL_LOADS&direction=all&includeUnconfirmedRoadworks=true' | |
r = requests.get(url) | |
for event in r.json(): | |
print(event) | |
# print(event['teEventType'], event['junction_ds_desc'], event['junction_us_desc'], event['cause']) | |
print('\n\n\n') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment