(self, request: Request, spider: Optional[Spider] = None)
return self._download(request, spider).addBoth(self._downloaded, request, spider)
Return a Deferred which fires with a Response as result, only downloader middlewares are applied
Return a Deferred which fires with a Response as result, only downloader middlewares are applied
Return a Deferred which fires with a Response as result only downloader middlewares are applied
def download(self, request: Request, spider: Optional[Spider] = None) -> Deferred:
        """Return a Deferred which fires with a Response as result, only downloader middlewares are applied"""
        if spider is None:
            spider = self.spider
        else:
            warnings.warn(
                "Passing a 'spider' argument to ExecutionEngine.download is deprecated",
                category=ScrapyDeprecationWarning,
                stacklevel=2,
            )
            if spider is not self.spider:
                logger.warning("The spider '%s' does not match the open spider", spider.name)
        if spider is None:
            raise RuntimeError(f"No open spider to crawl: {request}")
        return self._download(request, spider).addBoth(self._downloaded, request, spider)
def download ( self , request : Request , spider : Optional [ Spider ] = None ) -> Deferred : if spider is None : spider = self . spider else : warnings . warn ( "Passing a 'spider' argument to ExecutionEngine.download is deprecated" , category = ScrapyDeprecationWarning , stacklevel = 2 , ) if spider is not self . spider : logger . warning ( "The spider '%s' does not match the open spider" , spider . name ) if spider is None : raise RuntimeError ( f"No open spider to crawl: {request}" ) return self . _download ( request , spider ) . addBoth ( self . _downloaded , request , spider )