So, to override some parameters, one way would be to override / set custom_settings, a static spider variable, in our script.
so I imported the spider class and then redefined custom_setting:
from testspiders.spiders.followall import FollowAllSpider
FollowAllSpider.custom_settings={'RETRY_TIMES':10}
So this is the whole script:
from scrapy.crawler import CrawlerProcess
from scrapy.utils.project import get_project_settings
from testspiders.spiders.followall import FollowAllSpider
FollowAllSpider.custom_settings={'RETRY_TIMES':10}
process = CrawlerProcess(get_project_settings())
process.crawl('testspider', domain='scrapinghub.com')
process.start()
source
share