From 7bfcf57affedb4e23bb6e6d348300bc044f2b3af Mon Sep 17 00:00:00 2001 From: Andres Aguilera Date: Tue, 6 Oct 2020 08:56:23 -0300 Subject: [PATCH] Update changes from review --- kingfisher_scrapy/spiders/spain_zaragoza.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/kingfisher_scrapy/spiders/spain_zaragoza.py b/kingfisher_scrapy/spiders/spain_zaragoza.py index 26a14a34..5e788d83 100644 --- a/kingfisher_scrapy/spiders/spain_zaragoza.py +++ b/kingfisher_scrapy/spiders/spain_zaragoza.py @@ -32,6 +32,7 @@ def start_requests(self): # check date parameters and set "yyyy-MM-dd'T'HH:mm:ss'Z'" format if self.from_date and self.until_date: + # `before` and `after` query string parameters behave opposite in API after = self.until_date.strftime("%Y-%m-%dT%H:%M:%SZ") before = self.from_date.strftime("%Y-%m-%dT%H:%M:%SZ") url = url + '&before={}&after={}'.format(before, after) @@ -42,9 +43,7 @@ def start_requests(self): def parse_list(self, response): ids = json.loads(response.text) for contracting_process_id in ids: - - # A JSON array of ids strings - url = self.url + contracting_process_id.get('id') + url = self.url + contracting_process_id['id'] yield self.build_request(url, formatter=components(-1)) if self.sample: