使用scrapy每x分钟/秒抓取一次网站

时间:2016-11-21 16:40:04

标签: scrapy scrapy-spider

我正在使用Scrapy使用“scrapy crawl posts”命令抓取博客。 我需要每5分钟检查一次新帖子。 我该怎么办?

提前致谢。

1 个答案:

答案 0 :(得分:1)

修改您的/etc/crontab文件以包含此行。它会将您的脚本设置为每5分钟运行一次。

*/5 *   * * *   unix-username   cd /your/path/to/scrapy-project/;scrapy crawl posts

对于Windows,您可以查看提及here

的答案
相关问题