Using Deferred in Scrapy downloadermiddleware

I am going to use blocking code (this is waiting for a free proxy) in Scrapy downloadermiddleware. I was going to use this method

But it really does not work in downloadermiddleware, because the method is process_request(self, request, spider)waitingisinstance(response, (Response, Request))

What is the best way to do this?

+4
source share

All Articles