我试图从阳光基金会打开这个API的URL,并从JSON中的页面返回数据.这是我生成的代码,减go myapikey周围的括号.
import urllib.request.urlopen
import json
urllib.request.urlopen("https://sunlightlabs.github.io/congress/legislators?api_key='(myapikey)")
我得到了这个错误
Traceback (most recent call last):
File "<input>", line 1, in <module>
ImportError: No module named request.urlopen
我做错了什么?我研究了https://docs.python.org/3/library/urllib.request.html个,但仍然没有进展