我的代码遇到了一些麻烦,我希望从网站中提取一些链接,我正在使用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