Skip to content

Commit

Permalink
Update spiders that use archive_format = 'rar'
Browse files Browse the repository at this point in the history
Signed-off-by: Yohanna Lisnichuk <yohanitalisnichuk@gmail.com>
  • Loading branch information
yolile committed Jan 26, 2021
1 parent 75b60f5 commit 766a338
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
8 changes: 3 additions & 5 deletions kingfisher_scrapy/spiders/dominican_republic.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ class DominicanRepublic(CompressedFileSpider):
name = 'dominican_republic'
data_type = 'release_package'
compressed_file_format = 'release_package'
archive_format = 'rar'

def start_requests(self):
yield scrapy.Request(
Expand All @@ -25,9 +24,8 @@ def start_requests(self):

@handle_http_error
def parse_list(self, response):
urls = response.css('.fileLink::attr(href)').getall()
json_urls = list(filter(lambda x: '/JSON_DGCP_' in x, urls))
urls = response.css('.download::attr(href)').getall()
json_urls = list(filter(lambda x: '/JSON' in x, urls))

for url in json_urls:
if '/JSON_DGCP_' in url:
yield self.build_request(url, formatter=components(-1))
yield self.build_request(url, formatter=components(-1))
1 change: 0 additions & 1 deletion kingfisher_scrapy/spiders/mexico_nuevo_leon_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@


class MexicoNuevoLeonBase(CompressedFileSpider):
archive_format = 'rar'

def start_requests(self):
yield self.build_request(
Expand Down

0 comments on commit 766a338

Please sign in to comment.