我认为你正在寻找的是这样的:
import scrapyfrom scrapy.crawler import CrawlerProcessclass MySpider1(scrapy.Spider): # Your first spider definition ...class MySpider2(scrapy.Spider): # Your second spider definition ...process = CrawlerProcess()process.crawl(MySpider1)process.crawl(MySpider2)process.start() # the script will block here until all crawling jobs are finished



