How to download a file with Python?

0

This site has several links that open PDFs, in the "Full content" locations: link

In Python 3 I wrote this code to try to download a link:

import urllib.request, urllib.parse, urllib.error
url = "http://www.camara.gov.br/proposicoesWeb/prop_emendas?idProposicao=2122076&subst=0"
urllib.request.urlretrieve(url, "EMC 1-2017 PL678716 =- PL 6787-2016.pdf")

This message appears in Jupyter:

  

('EMC 1-2017 PL678716 = - PL 6787-2016.pdf',    )   )

You have downloaded a PDF file, but it does not open in Acrobat: could not open the file because this type of file was not supported or it was damaged

Please, does anyone know how to download the correct one?

    
asked by anonymous 14.09.2017 / 01:31

0 answers