From f9f3b634c6cdab7dcba443a87c4704a79a342206 Mon Sep 17 00:00:00 2001 From: aguilerapy Date: Wed, 4 Nov 2020 15:24:39 -0300 Subject: [PATCH 1/2] Use components(-2) --- kingfisher_scrapy/spiders/italy.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kingfisher_scrapy/spiders/italy.py b/kingfisher_scrapy/spiders/italy.py index a111b988..8f5007fd 100644 --- a/kingfisher_scrapy/spiders/italy.py +++ b/kingfisher_scrapy/spiders/italy.py @@ -1,7 +1,7 @@ import scrapy from kingfisher_scrapy.base_spider import SimpleSpider -from kingfisher_scrapy.util import components, handle_http_error, join +from kingfisher_scrapy.util import components, handle_http_error class Italy(SimpleSpider): @@ -26,4 +26,4 @@ def parse_list(self, response): html_urls = response.xpath('//a/@href').getall() for html_url in html_urls: if '.json' in html_url: - yield self.build_request(html_url, formatter=join(components(-2, -1), components(-1))) + yield self.build_request(html_url, formatter=components(-2)) From 9e701c7a1be7046871dcfa9a8a6ecba84456ca8e Mon Sep 17 00:00:00 2001 From: aguilerapy Date: Thu, 5 Nov 2020 14:27:12 -0300 Subject: [PATCH 2/2] Update docs --- docs/spiders.rst | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs/spiders.rst b/docs/spiders.rst index 7ca31b08..a3b92c29 100644 --- a/docs/spiders.rst +++ b/docs/spiders.rst @@ -601,6 +601,16 @@ Indonesia scrapy crawl indonesia_bandung +Italy +----- + +.. autoclass:: kingfisher_scrapy.spiders.italy.Italy + :no-members: + +.. code-block:: bash + + scrapy crawl italy + Kenya -----