Skip to content

Commit

Permalink
Update URL
Browse files Browse the repository at this point in the history
  • Loading branch information
aguilerapy committed Mar 10, 2021
1 parent be686d4 commit 39564e1
Showing 1 changed file with 19 additions and 8 deletions.
27 changes: 19 additions & 8 deletions kingfisher_scrapy/spiders/mexico_nuevo_leon_records.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,31 @@
from kingfisher_scrapy.spiders.mexico_nuevo_leon_base import MexicoNuevoLeonBase
import scrapy

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

class MexicoNuevoLeonRecords(MexicoNuevoLeonBase):

class MexicoNuevoLeonRecords(SimpleSpider):
"""
Domain
Secretaría de Infraestructura del Gobierno del Estado de Nuevo León
Bulk download documentation
http://si.nl.gob.mx/transparencia/acerca-del-proyecto
http://si.nl.gob.mx/transparencia/publicaciones
"""
name = 'mexico_nuevo_leon_records'

# BaseSpider
skip_pluck = 'Already covered (see code for details)' # mexico_nuevo_leon_releases

# SimpleSpider
data_type = 'record_package'

# CompressedFileSpider
file_name_must_contain = 'RecordPackage'
def start_requests(self):
yield scrapy.Request(
'http://si.nl.gob.mx/siasi_ws/api/ocds/DescargarRecordPackage?usuario=undefined&servidor=undefined',
meta={'file_name': 'list.json'},
callback=self.parse_list
)

@handle_http_error
def parse_list(self, response):
content = response.json()
url = content['urlWebOcdspackage']
if url:
yield self.build_request(url, formatter=components(-1))

0 comments on commit 39564e1

Please sign in to comment.