我的代码有问题,我想从网站中提取一些链接,我正在使用 BeautifulSoup 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