简体   繁体   English

跑步时更新刮y的蜘蛛

[英]update scrapy spider while running

I am using python scrapy package. 我正在使用python scrapy软件包。 Is there a way to update scrapy spider settings while the spider is running? 有一种方法可以在Spider运行时更新Scrapy Spider设置? I tried telnet console and update a setting by the following: 我尝试使用telnet控制台并通过以下方法更新设置:

settings.set('AUTOTHROTTLE_ENABLED', False)

'AUTOTHROTTLE_ENABLED' was True when I started the spider. 当我启动蜘蛛时,“ AUTOTHROTTLE_ENABLED”为True。 However, after the above command, the spider behavior didn't change. 但是,执行上述命令后,蜘蛛的行为没有改变。 Did I miss something? 我错过了什么? Thanks! 谢谢!

Scrapy settings are loaded when the engine is fired up and cannot be changed on the fly. Scrapy设置会在引擎启动时加载,并且无法即时更改。

I'm not sure what you are trying to achieve, but you should consider tweaking download_delay spider attribute on the fly. 我不确定您要达到的目标,但是您应该考虑即时调整download_delay spider属性

Besides, looking into autothrottle extension source code can help you come up with more options. 此外,研究autothrottle扩展源代码可以帮助您提供更多选择。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM