(self, result: Union[Response, Failure], request: Request, spider: Spider)
Handle the different cases of request's result been a Response or a Failure
Handle the different cases of request's result been a Response or a Failure
Handle the different cases of request s result been a Response or a Failure
def _scrape2(self, result: Union[Response, Failure], request: Request, spider: Spider) -> Deferred:
        """
        Handle the different cases of request's result been a Response or a Failure
        """
        if isinstance(result, Response):
            return self.spidermw.scrape_response(self.call_spider, result, request, spider)
        else:  # result is a Failure
            dfd = self.call_spider(result, request, spider)
            return dfd.addErrback(self._log_download_errors, result, request, spider)
def _scrape2 ( self , result : Union [ Response , Failure ] , request : Request , spider : Spider ) -> Deferred : if isinstance ( result , Response ) : return self . spidermw . scrape_response ( self . call_spider , result , request , spider ) else : # result is a Failure dfd = self . call_spider ( result , request , spider ) return dfd . addErrback ( self . _log_download_errors , result , request , spider )