Skip to content

Instantly share code, notes, and snippets.

@marcelrv
Last active July 15, 2019 18:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marcelrv/b04d4d47f5f1432c0f8185e7680de96f to your computer and use it in GitHub Desktop.
Save marcelrv/b04d4d47f5f1432c0f8185e7680de96f to your computer and use it in GitHub Desktop.
Vaarkaarten
import urllib.request
import json
url = 'https://vaarweginformatie.nl/frp/api/webcontent/downloads?pageId=infra/enc'
req = urllib.request.Request(url)
##parsing response
r = urllib.request.urlopen(req).read()
cont = json.loads(r.decode('utf-8'))
counter = 0
print (cont)
##parcing json
for item in cont:
counter += 1
print("name:", item['name'], "\nDownload URL:", ' https://vaarweginformatie.nl/fdd/main/wicket/resource/org.apache.wicket.Application/downloadfileResource?fileId='+str(item['fileId']))
##print formated
#print (json.dumps(cont, indent=4, sort_keys=True))
print("Number of titles: ", counter)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment