Download de arquivos PDF com Python

    import requests
    import pathlib

    url = 'https://readthedocs.org/projects/python-guide/downloads/pdf/latest/'

    myfile = requests.get(url, allow_redirects=True)

    pathlib.Paht('~/documents/hello.pdf').expanduser().write_bytes(myfile.content)

Comentários