Name: scrap_correios_invoices
Owner: Olist
Description: Download Correios Invoices
Created: 2018-05-21 20:57:59.0
Updated: 2018-05-21 20:59:38.0
Pushed: 2014-06-27 10:58:17.0
Size: 360
Language: Python
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
The Justice Department in Peru (Poder Judicial, PJ) has released thousands of veredicts from the Supreme Court. All are in PDF format (images, not text). The only way to download is by using their website and download one by one, which is far from efficient. They don't offer downloads of documents in batches of more than 5.
This project aims to be an efficient way to download the documents from the PJ website by scrapping their website using scrapy.
This software executes the steps 1 to 5:
mojarra.jsfcljs(document.getElementById('formBusqueda'),{'formBusqueda:repeat:0:j_idt158':'formBusqueda:repeat:0:j_idt158','uuid':'47cd6b37-8c7b-4cd0-b46a-adb4755bb161'},'');
Assuming that you have Python 2.7+ isntalled in your computer:
install scrapy
clone https://github.com/aniversarioperu/scrapy_pj.git
Replace the “expediente” number for the one(s) that your wish to download:
py crawl search_pj -a expediente=00001-2013 -t json -o output.json
Expected output is a bunch of PDF files downloaded to current folder:
lucion_000001-2013-1390676516593.pdf
lucion_000001-2013-1390773912770.pdf
lucion_000001-2013-20140225102936000838852.pdf
lucion_000001-2013-20140227102906000571555.pdf
lucion_000001-2013-20140228170931000865573.pdf
lucion_000001-2013-20140304171117000584898.pdf
lucion_000001-2013-20140310115239000895619.pdf
lucion_000001-2013-20140311151759000566176.pdf
[Optional] If using Ubuntu, add this line to /etc/apt/sources.list
:
http://deb.torproject.org/torproject.org saucy main
Then do:
--keyserver keys.gnupg.net --recv 886DDD89
--export A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89 | sudo apt-key add -
get update
get install deb.torproject.org-keyring
get install tor
More info here https://www.torproject.org/docs/tor-doc-unix.html.en#using
Install polipo, more info here.