Skip to content

Commit

Permalink
Add scraping one day condition
Browse files Browse the repository at this point in the history
  • Loading branch information
aguilerapy committed Nov 3, 2020
1 parent 802d822 commit ceef349
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions kingfisher_scrapy/base_spider.py
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,9 @@ def next_link(self, response, **kwargs):
if url:
return self.build_request(url, formatter=self.next_page_formatter, **kwargs)

if self.from_date and self.until_date and (self.until_date - self.from_date).days <= 1:
return

if response.meta['depth'] == 0:
raise MissingNextLinkError(f'next link not found on the first page: {response.url}')

Expand Down

0 comments on commit ceef349

Please sign in to comment.