1 # -*- coding:utf-8 -*- 2 3 from scrapy import cmdline 4 from scrapy.cmdline import execute 5 import sys,time,os 6 7 #会全部执行爬虫程序 8 os.system(‘scrapy crawl ccdi‘) 9 os.system(‘scrapy crawl ccxi‘) 10 #----------------------------------------------------- 11 12 #只会执行第一个 13 cmdline.execute(‘scrapy crawl ccdi‘.split()) 14 cmdline.execute(‘scrapy crawl ccxi‘.split()) 15 #----------------------------------------------------- 16 17 #只会执行第一个 18 sys.path.append(os.path.dirname(os.path.abspath(__file__))) 19 execute(["scrapy", "crawl", "shanghaione"]) 20 time.sleep(30) 21 22 sys.path.append(os.path.dirname(os.path.abspath(__file__))) 23 execute(["scrapy", "crawl", "shanghaitwo"])