Skip to content

Commit

Permalink
Merge ad61829 into 4cebb6c
Browse files Browse the repository at this point in the history
  • Loading branch information
nativaldezt committed Dec 29, 2020
2 parents 4cebb6c + ad61829 commit 6f8ca16
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions kingfisher_scrapy/spiders/ecuador_emergency.py
Expand Up @@ -21,5 +21,8 @@ def start_requests(self):
@handle_http_error
def parse_list(self, response):
html_urls = response.xpath('//a/@href').getall()
for html_url in html_urls:
yield self.build_request(response.request.url + html_url, formatter=components(-1))
if html_urls:
# Each link contains different versions of SERCOP's emergency dataset, only the newest should be downloaded
# URL format: ./archivos/ocds-YYYY-MM-DD.json
html_urls.sort(reverse=True)
yield self.build_request(f'{response.request.url}{html_urls[0]}', formatter=components(-1))

0 comments on commit 6f8ca16

Please sign in to comment.