wget

3.2 · deprecated · verified Fri Apr 10

The `wget` Python library (version 3.2) is a pure Python download utility designed for simple file retrieval from HTTP URLs. It provides basic functionality to download files, optionally displaying a progress bar. It is distinct from the widely-used command-line utility GNU Wget, which offers more advanced features. The package's last update was in 2015, making it largely unmaintained compared to newer alternatives.

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to download a file using the `wget.download()` function. The function returns the local filename of the downloaded content. The `out` parameter specifies the output filename, otherwise it defaults to the basename of the URL.

import wget
import os

url = 'https://www.python.org/static/img/python-logo.png'
output_filename = 'python-logo.png'

# Ensure clean state for demonstration
if os.path.exists(output_filename):
    os.remove(output_filename)

print(f"Downloading {url}...")
filename = wget.download(url, out=output_filename)
print(f"\nDownloaded to: {filename}")

view raw JSON →