Extract Images
Extracts image URLs from HTML content by finding all img tags and their src attributes.
Common Properties
- Name - The custom name of the node.
- Color - The custom color of the node.
- Delay Before (sec) - Waits in seconds before executing the node.
- Delay After (sec) - Waits in seconds after executing node.
- Continue On Error - Automation will continue regardless of any error. The default value is false.
info
If the ContinueOnError property is true, no error is caught when the project is executed, even if a Catch node is used.
Inputs
- HTML Element - The HTML content to parse for image tags.
Options
This node does not have any options.
Output
- Image URLs - An array of strings containing the URLs of all images found in the HTML content.
How It Works
The Extract Images node parses HTML content and extracts the source URLs of all image tags. When executed, the node:
- Retrieves the HTML Element input variable
- Validates that the HTML content is not empty
- Creates a goquery document from the HTML content
- Finds all img tags in the HTML document
- Extracts the src attribute from each img tag
- Collects all extracted URLs into an array
- Sets the array of image URLs as the output variable
Requirements
- Valid HTML content containing img tags
- Non-empty HTML Element input
Error Handling
The node will return specific errors in the following cases:
- Empty or invalid HTML Element input - "HTML Element input cannot be empty"
- Malformed HTML that cannot be parsed
Usage Notes
- Only extracts images that have a src attribute defined
- Ignores img tags without a src attribute
- Returns an empty array if no img tags are found in the HTML
- Works with both absolute and relative image URLs
- Can handle various HTML structures and nested elements
- Useful for web scraping, content analysis, and media extraction tasks
- The extracted URLs can be used with other nodes to download or process the images
- Supports standard HTML img tags with src attributes
- The order of URLs in the output array matches the order of img tags in the HTML