opening a url with urllib in python 3
i'm trying to open the URL of this API from the sunlight foundation and return the data from the page in json. this is the code Ive produced, minus the parenthesis around myapikey. import urllib.request.urlopen import json urllib.request.urlopen("https://sunlightlabs.github.io/congress/legislators?api_key='(myapikey)") and im getting this error Traceback (most recent call last): File "<input>", line 1, in <module> ImportError: No module named request.urlopen what am i doing wrong? ive researched into https://docs.python.org/3/library/urllib.request.html and still no progress You need to use