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 m
You need to use from urllib.request import urlopen, also I suggest you use the with statement while opening a connection.
from urllib.request import urlopen
with
from urllib.request import urlopen with urlopen("https://sunlightlabs.github.io/congress/legislators?api_key='(myapikey)") as conn: # dosomething