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+
wgetinstalled 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
wgetis installed:wget --version
If not installed, refer to GNU Wget for installation instructions.
python3 batch_wget.py https://example.com/page1python3 batch_wget.py https://example.com/page1 https://site.org/anotherpython3 batch_wget.py -f urls.txtWhere urls.txt contains one URL per line.([GitHub][2])
python3 batch_wget.py -f urls.txt -o downloads/python3 batch_wget.py -husage: 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
subprocessmodule - Relies on the powerful
wgettool for downloading