I am trying to download a pdf file from a website using urllib. This is what i got so far:
import urllib def download_file(download_url): web_file = url
Try to use urllib.retrieve (Python 3) and just do that:
urllib.retrieve
from urllib.request import urlretrieve def download_file(download_url): urlretrieve(download_url, 'path_to_save_plus_some_file.pdf') if __name__ == 'main': download_file('http://www.example.com/some_file.pdf')