From 5a4360ce90ca118f7c806796b223a72692322a2b Mon Sep 17 00:00:00 2001 From: Andres Aguilera Date: Tue, 23 Jun 2020 22:33:49 -0400 Subject: [PATCH] Update changes --- kingfisher_scrapy/spiders/moldova_mtender.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/kingfisher_scrapy/spiders/moldova_mtender.py b/kingfisher_scrapy/spiders/moldova_mtender.py index 3c2a32be..011733d8 100644 --- a/kingfisher_scrapy/spiders/moldova_mtender.py +++ b/kingfisher_scrapy/spiders/moldova_mtender.py @@ -1,7 +1,9 @@ import json +import scrapy + from kingfisher_scrapy.base_spider import SimpleSpider -from kingfisher_scrapy.util import components, handle_http_error, join, parameters, replace_parameter +from kingfisher_scrapy.util import components, handle_http_error, parameters, replace_parameter class MoldovaMTender(SimpleSpider): @@ -15,7 +17,7 @@ class MoldovaMTender(SimpleSpider): def start_requests(self): url = 'https://public.mtender.gov.md/tenders/' - yield self.build_request(url, formatter=components(-1), callback=self.parse_list) + yield scrapy.Request(url, meta={'file_name': 'offset-0.json'}, callback=self.parse_list) @handle_http_error def parse_list(self, response): @@ -31,4 +33,4 @@ def parse_list(self, response): return url = replace_parameter(response.request.url, 'offset', data['offset']) - yield self.build_request(url, formatter=join(components(-1), parameters('offset')), callback=self.parse_list) + yield self.build_request(url, formatter=parameters('offset'), callback=self.parse_list)