我想run scrapy from a single script運行scrapy更改設置,我想從settings.py所有設置,但我希望能夠改變一些人:如果能夠同時從腳本
from scrapy.crawler import CrawlerProcess
from scrapy.utils.project import get_project_settings
process = CrawlerProcess(get_project_settings())
*### so what im missing here is being able to set or override one or two of the settings###*
# 'followall' is the name of one of the spiders of the project.
process.crawl('testspider', domain='scrapinghub.com')
process.start() # the script will block here until the crawling is finished
我無法使用this。我試過以下內容:
settings=scrapy.settings.Settings()
settings.set('RETRY_TIMES',10)
但它沒有工作。
注意:我正在使用最新版本的scrapy。