You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to know if it's possible to configure the proxy middleware in a way that it applies only to specific spiders instead of all spiders in a Scrapy project.
For example, I want to have a toggle or setting for each spider that decides whether proxies should be used or not. Is there a recommended way to achieve this using the Scrapy framework?
Example Use Case:
Spider A should use proxies.
Spider B should not use proxies.
Would it be possible to configure the middleware dynamically per spider or implement logic to check this toggle and enable/disable the middleware accordingly? If yes, could you provide guidance or examples?
Thank you!
The text was updated successfully, but these errors were encountered:
Yes you can simply keep this middleware off for any spider that you dont need it by overriding settings on sniper creation. You can tailor any setting for a specific spider using update_settings classmethod
Best practice for middlewares is that it should have an ENABLED flag/value which users could use to enable/disable the middleware but this one does not have such parameter, instead you can clear the list of proxies and the middleware will deactivate itself automatically based on its initialization logic
Good day !
I would like to know if it's possible to configure the proxy middleware in a way that it applies only to specific spiders instead of all spiders in a Scrapy project.
For example, I want to have a toggle or setting for each spider that decides whether proxies should be used or not. Is there a recommended way to achieve this using the Scrapy framework?
Example Use Case:
Spider A should use proxies.
Spider B should not use proxies.
Would it be possible to configure the middleware dynamically per spider or implement logic to check this toggle and enable/disable the middleware accordingly? If yes, could you provide guidance or examples?
Thank you!
The text was updated successfully, but these errors were encountered: