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()