Skip to content

Commit

Permalink
Merge 20b15e4 into 9896b76
Browse files Browse the repository at this point in the history
  • Loading branch information
aguilerapy committed Jun 24, 2020
2 parents 9896b76 + 20b15e4 commit defcfc6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions kingfisher_scrapy/spiders/moldova_mtender.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,20 @@ class MoldovaMTender(SimpleSpider):
"""
name = 'moldova_mtender'
data_type = 'release_package'
base_url = 'http://public.eprocurement.systems/ocds/tenders/'

def start_requests(self):
url = 'https://public.mtender.gov.md/tenders/'
yield self.build_request(url, formatter=components(-1), callback=self.parse_list)

@handle_http_error
def parse_list(self, response):
base_url = 'http://public.eprocurement.systems/ocds/tenders/'
data = json.loads(response.text)
# The last page returns an empty JSON object.
if not data:
return
for item in data['data']:
yield self.build_request(self.base_url + item['ocid'], formatter=components(-2))
yield self.build_request(base_url + item['ocid'], formatter=components(-1))

if self.sample:
return
Expand Down

0 comments on commit defcfc6

Please sign in to comment.