2013-11-01 50 views
6

我目前正在與蟒蛇「的urllib」模塊打,並嘗試這種提取網頁的源代碼:urllib模塊錯誤! AttributeError的:「模塊」對象有沒有屬性「的要求」

import urllib 
temp = urllib.request.urlopen('https://www.quora.com/#') 

但是,我得到的以下錯誤:

Traceback (most recent call last): File "", line 1, in temp = urllib.request.urlopen(' https://www.quora.com/# ') AttributeError: 'module' object has no attribute 'request'

我正在使用Python 2.7.5。

+0

文檔告訴你有關「urllib.request.urlopen」的文檔在哪裏? –

+0

http://docs.python.org/3.3/howto/urllib2.html –

+0

Python 3文檔= Python 2文檔?想想吧 –

回答

相關問題