From f66731452fb8b3dcd7b43c282670eac0eaa74053 Mon Sep 17 00:00:00 2001 From: James McKinney <26463+jpmckinney@users.noreply.github.com> Date: Fri, 26 Feb 2021 20:59:55 -0500 Subject: [PATCH] crawlall: Optionally pass specific spiders as arguments --- kingfisher_scrapy/commands/crawlall.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/kingfisher_scrapy/commands/crawlall.py b/kingfisher_scrapy/commands/crawlall.py index beb6c852..86fab29a 100644 --- a/kingfisher_scrapy/commands/crawlall.py +++ b/kingfisher_scrapy/commands/crawlall.py @@ -16,6 +16,9 @@ def yield_nothing(*args, **kwargs): class CrawlAll(ScrapyCommand): + def syntax(self): + return '[options] [spider ...]' + def short_desc(self): return 'Run all spiders' @@ -50,7 +53,7 @@ def run(self, args, opts): self.settings.set('EXTENSIONS', extensions) for spider_name in self.crawler_process.spider_loader.list(): - if spider_name not in EXCEPTIONS: + if not args and spider_name not in EXCEPTIONS or spider_name in args: spidercls = self.crawler_process.spider_loader.load(spider_name) self.crawler_process.crawl(spidercls, **kwargs)