-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
61 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
from kingfisher_scrapy.base_spider import CompressedFileSpider | ||
from kingfisher_scrapy.util import components | ||
|
||
|
||
class MexicoAPFBulk(CompressedFileSpider): | ||
""" | ||
Domain | ||
Administración Pública Federal (APF) - Secretaria de la Función Pública (SFP) - Secretaría de Hacienda y Crédito | ||
Público (SHCP) | ||
Bulk download documentation | ||
https://datos.gob.mx/busca/dataset/concentrado-de-contrataciones-abiertas-de-la-apf | ||
""" | ||
name = 'mexico_apf_bulk' | ||
|
||
# BaseSpider | ||
root_path = 'item' | ||
|
||
# CompressedFileSpider | ||
data_type = 'release' | ||
|
||
def start_requests(self): | ||
url = 'https://compranetinfo.hacienda.gob.mx/dabiertos/contrataciones_arr.json.zip' | ||
yield self.build_request(url, formatter=components(-1)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import scrapy | ||
|
||
from kingfisher_scrapy.base_spider import CompressedFileSpider | ||
from kingfisher_scrapy.util import components, handle_http_error | ||
|
||
|
||
class MexicoAPFSHCPBulk(CompressedFileSpider): | ||
""" | ||
Domain | ||
Administración Pública Federal (APF) - Secretaría de Hacienda y Crédito Público (SHCP) | ||
Bulk download documentation | ||
https://datos.gob.mx/busca/dataset/concentrado-de-contrataciones-abiertas-de-la-apf-shcp | ||
""" | ||
name = 'mexico_apf_shcp_bulk' | ||
|
||
# BaseSpider | ||
root_path = 'item' | ||
|
||
# CompressedFileSpider | ||
data_type = 'release' | ||
|
||
def start_requests(self): | ||
yield scrapy.Request( | ||
'https://drive.google.com/uc?id=1dHsnijrC_IQyGn0eY4ZzFwDLiJ-8kpS3', | ||
meta={'file_name': 'confirmation.html'}, | ||
callback=self.parse_list | ||
) | ||
|
||
@handle_http_error | ||
def parse_list(self, response): | ||
url = response.xpath('//a[@id="uc-download-link"]/@href').get() | ||
yield self.build_request(url=f'https://drive.google.com{url}', | ||
formatter=components(-1), | ||
meta={'file_name': 'contrataciones.zip'}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,6 @@ | |
|
||
|
||
class MexicoPlataformaDigitalNacional(CompressedFileSpider): | ||
|
||
""" | ||
Domain | ||
Plataforma Digital Nacional | ||
|