A Python script to recursively download full websites using wget
, ideal for offline access, archiving, or mirroring.
- Supports multiple URLs via command-line or input file
- Preserves directory structure and page assets
- Converts links for offline browsing
- Optional output directory support
- Built-in error handling and verbose output
- Python 3.6+
wget
installed and available in your system's PATH
-
Clone the repository:([GitHub][1])
git clone https://github.com/yourusername/batch-wget-downloader.git cd batch-wget-downloader
-
Ensure
wget
is installed:wget --version
If not installed, refer to GNU Wget for installation instructions.
python3 batch_wget.py https://example.com/page1
python3 batch_wget.py https://example.com/page1 https://site.org/another
python3 batch_wget.py -f urls.txt
Where urls.txt
contains one URL per line.([GitHub][2])
python3 batch_wget.py -f urls.txt -o downloads/
python3 batch_wget.py -h
usage: batch_wget.py [-h] [-f FILE] [-o OUTPUT_DIR] [urls ...]
Batch-download multiple sites with wget.
positional arguments:
urls List of URLs to download. If none specified, use --file.
options:
-h, --help show this help message and exit
-f FILE, --file FILE Path to a text file containing one URL per line.
-o OUTPUT_DIR, --output-dir OUTPUT_DIR
Directory in which to store all downloads (passed to wget -P).
python3 batch_wget.py -f urls.txt -o saved_sites/
This command will download all websites listed in urls.txt
and save them in the saved_sites/
directory.
This project is licensed under the MIT License. See the LICENSE file for details.
- Built using Python's
subprocess
module - Relies on the powerful
wget
tool for downloading