This Python script allows you to download images from an HTML file by extracting image URLs and saving the images to a specified directory. It can be useful when you need to scrape images from a web page or process HTML content containing image links.
- Downloads images from an HTML file.
- Supports various image formats such as JPG, PNG, GIF, MP4, and WebP.
- Provides flexibility to specify the output directory for downloaded images.
- Install Python if you haven't already (https://www.python.org/).
- Clone this repository or download the script
assets_loader.py
. - Prepare your HTML file containing image links.
- Open a terminal or command prompt and navigate to the directory containing the script.
- Run the script by executing the command:
python assets_loader.py file_name.html
Replace file_name.html
with the path to your HTML file.
- Specify the directory where you want to save the downloaded images when prompted.
Suppose you have an HTML file named example.html
with image links. You can use this script to download the images by running:
python assets_loader.py example.html
- requests: For making HTTP requests to download images.
- re: For regular expression-based pattern matching.
- os: For interacting with the file system.
Feel free to contribute or report issues here.