Beautifulsoup的问题

时间:2013-09-03 14:26:20

标签: beautifulsoup urllib2

我的代码遇到了一些麻烦,我希望从网站中提取一些链接,我正在使用Beautiful 4。

from BeautifulSoup import BeautifulSoup
import urllib2 
url ="http://www.mysite" 
content = urllib2.urlopen(url).read()
soup = BeautifulSoup(content)
for link in soup.find_all('a'):  
    print(link.get('href'))

我收到此消息

for link in soup.find_all('a'):
TypeError: 'NoneType' object is not callable

0 个答案:

没有答案