【发布时间】:2014-09-15 19:19:27
【问题描述】:
我是 Python 新手,我正在尝试制作一个仅打印文章(例如此网站 -http://techcrunch.com/2014/09/15/microsoft-has-acquired-minecraft/)而不是网站上的其他内容的网络爬虫。我试过这个(这不起作用):
source_code = requests.get('http://techcrunch.com/2014/09/15/microsoft-has-acquired-minecraft/')
plain_text = source_code.text
soup = BeautifulSoup(plain_text)
for link in soup.findAll('div', {'class': 'article-entry text'}):
title = link.string
print(title)
及其打印:'无' 谢谢
【问题讨论】:
标签: python web-scraping web-crawler