motherspider.py 612 B

123456789101112131415161718
  1. # import the spiders you want to run
  2. from spiders.toscrape import ToScrapeSpider
  3. from spiders.toscrape2 import ToScrapeSpiderTwo
  4. # scrapy api imports
  5. # from scrapy import signals, log
  6. from scrapy import signals
  7. import logging
  8. from twisted.internet import reactor
  9. # from scrapy.crawler import Crawler
  10. from scrapy.crawler import CrawlerProcess
  11. # from scrapy.crawler import CrawlerRunner
  12. from scrapy.settings import Settings
  13. process = CrawlerProcess()
  14. process.crawl(ToScrapeSpider)
  15. process.crawl(ToScrapeSpiderTwo)
  16. process.start() # the script will block here until all crawling jobs are finished