Skip to content

Commit

Permalink
Update changes from review
Browse files Browse the repository at this point in the history
  • Loading branch information
aguilerapy committed Oct 6, 2020
1 parent 1421373 commit 7bfcf57
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions kingfisher_scrapy/spiders/spain_zaragoza.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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:
Expand Down

0 comments on commit 7bfcf57

Please sign in to comment.