1
CODE:NameError:名稱 '的urllib' 沒有定義「
import networkx as net
from urllib.request import urlopen
def read_lj_friends(g, name):
# fetch the friend-list from LiveJournal
response=urllib.urlopen('http://www.livejournal.com/misc/fdata.bml?user='+name)
錯誤:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'urllib' is not defined
'urllib'是標準庫的一部分。你不需要安裝'urllib3'這是一個不同的庫。另外,'urlopen'返回一個類似文件的對象,而不是html。 – interjay
複雜,抱歉。我正在修復它。感謝您的警告。 –