I have a scrapy project with two spiders. Also I created test.py (in this scrapy project) to crawl spiders
code :
from scrapy.crawler import CrawlerProcess
from scrapy.utils.project import get_project_settings
process = CrawlerProcess(get_project_settings())
process.crawl('nameofspider1', domain='domain')
process.crawl('nameofspider2', domain='domain')
process.start()
and it works fine.
The problem is when I want to run this script (test.py) from another python script, then I got
KeyError: 'Spider not found:
nameofspider1'
The code of the second python script:
import os
os.system('python C:\Users\Adam\nameofproject\test.py')
Thanks for all replies.