NameError: name 'urllib' is not defined "

后端 未结 5 1586
日久生厌
日久生厌 2021-02-09 08:13

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:40

    You've imported urlopen directly, so you should refer to it like that rather than via urllib:

    response = urlopen('...')
    

提交回复
热议问题