Created
November 11, 2016 13:47
-
-
Save peeterskris/0216c6aa09def961758561e14880d89f 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
stations_url = 'https://irail.be/stations/NMBS' | |
folder = 'data/' | |
response = requests.get(stations_url, headers={'accept': 'application/json'}, verify=False) | |
if response.ok: | |
data = json.loads(response.content) | |
filename = path.join(folder, 'stations.json') | |
with open(filename, 'w') as outfile: | |
json.dump(data, outfile, indent=4) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment