Skip to content

Instantly share code, notes, and snippets.

@peeterskris
Created November 11, 2016 13:47
Show Gist options
  • Save peeterskris/0216c6aa09def961758561e14880d89f to your computer and use it in GitHub Desktop.
Save peeterskris/0216c6aa09def961758561e14880d89f to your computer and use it in GitHub Desktop.
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