Source code for kingfisher_scrapy.spiders.nepal_dhangadhi

import scrapy

from kingfisher_scrapy.base_spiders import SimpleSpider
from kingfisher_scrapy.util import components, handle_http_error

[docs]class NepalDhangadhi(SimpleSpider): """ Domain Dhangadhi Infrastructure Management System (IMS) Caveats Some URLs listed in require login and cannot be downloaded Bulk download documentation """ name = 'nepal_dhangadhi' # SimpleSpider data_type = 'release_package' def start_requests(self): yield scrapy.Request( '', meta={'file_name': 'list.json'}, callback=self.parse_list, ) @handle_http_error def parse_list(self, response): for number, item in enumerate(reversed(response.json()['data']['fiscal_years'])): # A URL might redirect to yield self.build_request(f'{item["name"]}.json', formatter=components(-1), meta={'dont_redirect': True}, priority=number * -1)