mirror of https://github.com/scrapy/scrapy.git
Simplify the get_retry_request code example
This commit is contained in:
parent
c0f3ca1938
commit
94201612bc
|
|
@ -55,14 +55,12 @@ def get_retry_request(
|
|||
|
||||
def parse(self, response):
|
||||
if not response.text:
|
||||
new_request = get_retry_request(
|
||||
new_request_or_none = get_retry_request(
|
||||
response.request,
|
||||
spider=self,
|
||||
reason='empty',
|
||||
)
|
||||
if new_request:
|
||||
yield new_request
|
||||
return
|
||||
return new_request_or_none
|
||||
|
||||
*spider* is the :class:`~scrapy.Spider` instance which is asking for the
|
||||
retry request. It is used to access the :ref:`settings <topics-settings>`
|
||||
|
|
|
|||
Loading…
Reference in New Issue