【发布时间】:2015-10-13 04:45:37
【问题描述】:
我想run scrapy from a single script 并且我想从 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。
【问题讨论】: