CrawlerProcess vs CrawlerRunner

前端 未结 2 2020

Scrapy 1.x documentation explains that there are two ways to run a Scrapy spider from a script:

  • using CrawlerProcess
  • using CrawlerRunner
2条回答
  •  半阙折子戏
    2020-12-29 04:21

    CrawlerRunner:

    This class shouldn’t be needed (since Scrapy is responsible of using it accordingly) unless writing scripts that manually handle the crawling process. See Run Scrapy from a script for an example.

    CrawlerProcess:

    This utility should be a better fit than CrawlerRunner if you aren’t running another Twisted reactor within your application.

    It sounds like the CrawlerProcess is what you want unless you're adding your crawlers to an existing Twisted application.

提交回复
热议问题