NameError: name 'urllib' is not defined "

后端 未结 5 1690
不思量自难忘°
不思量自难忘° 2021-02-09 07:47

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 08:30

    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)
    

提交回复
热议问题