Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个带有多个蜘蛛的 Scrapy 项目。该项目托管在一个 scrapyd 实例上。我希望能够动态更改项目 settings.py 文件中的设置(例如 DOWNLOADER_MIDDLEWARES)。
是否可以在向 scrapyd 实例发送请求时更改这些设置。请注意,我不想创建多个项目,因为这将导致跨项目重复公共代码。
谢谢
您可以将参数传递给 scrapyd 并使用 -d 参数更改设置
curl http://localhost:6800/schedule.json -d project=myproject -d spider=somespider -d setting=DOWNLOAD_DELAY=2 -d arg1=val1