2016-11-14 67 views
-2

我現在正在學習Python 2.7中的爬行。我收到以下錯誤python 2.7 Beautifulsoup錯誤(對於windows)

TypeError: 'module' object is not callable

img

+3

'from bs4 import BeautifulSoup' –

+0

請勿鏈接到非現場資源。 **直接在您的問題**中添加所有相關資源。 –

+0

請更新您的問題以包含導致問題的源代碼。 – Soviut

回答

1

基本上當您導入BeautifulSoup導入的庫或模塊。而不是導入BeautifulSoup類。所以要解決你的問題就像這樣。

BeautifulSoup.BeautifulSoup(urllib2.urlopen(url).read()) 
+0

哦!謝謝你幫助我。錯誤得到解決。它運作良好。 –