import urllib.request
pdf_path = ""
def download_file(download_url, filename):
response = urllib.request.urlopen(download_url)
file = open(filename + ".pdf", 'wb')
file.write(response.read())
file.close()
download_file(pdf_path, "Test")
import requests
url = 'your_url/name_pdf.pdf'
content = requests.get(url).content
filename = url.split('/')[-1]
with open(filename, 'wb') as f:
f.write(content)
f.close()