【发布时间】:2017-11-30 13:05:41
【问题描述】:
我正在制作一个爬虫来查找最近添加的 youtube 视频我想在我的爬虫到达旧视频时停止我的爬虫(在上一轮爬取)。我没有使用scrapy 和beautifulsoup 我使用的是python 库。请建议我任何选择
【问题讨论】:
标签: python beautifulsoup scrapy web-crawler html-parsing
我正在制作一个爬虫来查找最近添加的 youtube 视频我想在我的爬虫到达旧视频时停止我的爬虫(在上一轮爬取)。我没有使用scrapy 和beautifulsoup 我使用的是python 库。请建议我任何选择
【问题讨论】:
标签: python beautifulsoup scrapy web-crawler html-parsing
不会简单的检查和通过工作吗?
if video in list_of_crawled_videos:
pass
else:
list_of_crawled_videos.append(video)
【讨论】:
break 替换为pass =)