Equivalent of 'wget' for python?

Discussion in 'Python' started by Robert Dailey, Dec 8, 2008.

  1. Hi,

    I'm looking for a portable way to download ZIP files on the internet
    through Python. I don't want to do os.system() to invoke 'wget', since
    this isn't portable on Windows. I'm hoping the core python library has
    a library for this. Note that I'll be using Python 3.0.

    Thanks.
     
    Robert Dailey, Dec 8, 2008
    #1
    1. Advertisements

  2. Module urllib2

    Diez
     
    Diez B. Roggisch, Dec 8, 2008
    #2
    1. Advertisements

  3. Robert Dailey

    r0g Guest


    urllib.urlretrieve(url_of_zip_file, destination_on_local_filesystem).

    There's also a third argument you can use to link a progress update
    function of your choosing if you need it.


    Roger.
     
    r0g, Dec 8, 2008
    #3
  4. Robert Dailey

    Jerry Hill Guest

    In python 3.0, that appears to be:

    import urllib.request
    urllib.request.urlretrieve(url, local_file_name)
     
    Jerry Hill, Dec 8, 2008
    #4
  5. Robert Dailey

    Leo Jay Guest

    You can get Wget for Windows here:
    http://gnuwin32.sourceforge.net/packages/wget.htm
     
    Leo Jay, Dec 11, 2008
    #5
  6. This module might be of interest:

    http://linux.duke.edu/projects/urlgrabber/
     
    member thudfoo, Dec 11, 2008
    #6
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.