Skip to content

Commit

Permalink
chore(united_kingdom_contracts_finder_base): Simplify default until_date
Browse files Browse the repository at this point in the history
  • Loading branch information
jpmckinney committed Sep 20, 2023
1 parent db7d544 commit 7964b33
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from datetime import datetime

import scrapy

from kingfisher_scrapy.base_spiders import LinksSpider
Expand Down Expand Up @@ -32,7 +34,7 @@ def start_requests(self):
until_date = self.until_date.strftime(self.date_format)
url = f'{url}&publishedFrom={from_date}&publishedTo={until_date}'
else:
until_date = self.get_default_until_date(self).strftime(self.date_format)
until_date = datetime.utcnow().strftime(self.date_format)

yield scrapy.Request(url, meta={'file_name': f'{until_date}.json'}) # reverse chronological order

Expand Down

0 comments on commit 7964b33

Please sign in to comment.