Skip to content

Commit

Permalink
crawlall: Optionally pass specific spiders as arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
jpmckinney committed Feb 27, 2021
1 parent acd4210 commit f667314
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion kingfisher_scrapy/commands/crawlall.py
Expand Up @@ -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'

Expand Down Expand Up @@ -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)

Expand Down

0 comments on commit f667314

Please sign in to comment.