NameError: name 'urllib' is not defined "

前端 未结 5 922
傲寒
傲寒 2021-02-09 04:28

CODE:

import networkx as net
from urllib.request import urlopen
def read_lj_friends(g, name):
# fetch the friend-list from LiveJournal
response=urllib.urlopen(\'         


        
5条回答
  •  孤城傲影
    2021-02-09 05:15

    For your case:

    import networkx as net
    from urllib.request import urlopen
    def read_lj_friends(g, name):
    # fetch the friend-list from LiveJournal
    response=urlopen('http://www.livejournal.com/misc/fdata.bml?user='+name)
    

提交回复
热议问题