Actions74
- ai Actions
- array Actions
- audiovideo Actions
- carbone Actions
- charts Actions
- code Actions
- data Actions
- datetime Actions
- events Actions
- files Actions
- geo Actions
- hellospaces Actions
- images Actions
- Get Metadata of an Image
- Scale an Image
- Overlay an Image on another Image
- Scale an Image to Fit Given Dimensions
- Resize an Image
- Mask an Image with Another Image
- Mask an Image with a Circle Mask
- Crops an image by the given x, y, width and height paramters.
- Convert Texts to an Image
- Convert HTML String or URL to an Image
- Generates a QRCode with given text and color.
- Get EXIF from Image
- Remove EXIF from Image
- Modify Image EXIF
- playground Actions
- spreadsheet Actions
- stripe Actions
- youtube Actions
data → Scrape HTML
AI-generatedOverview
The Scrape HTML operation under the data resource in this custom n8n node allows users to extract specific information from an HTML string or a website URL using CSS selectors. This is particularly useful for automating data extraction tasks such as web scraping, content aggregation, or monitoring changes on web pages.
Common scenarios:
- Extracting product details (price, title, image) from e-commerce sites.
- Collecting article headlines or summaries from news websites.
- Gathering structured data from any public webpage for further processing in your automation workflows.
Practical example:
You could use this node to scrape all links (<a> tags with href attributes) from a given HTML page and output them as structured JSON for downstream processing.
Properties
| Name | Meaning |
|---|---|
| HTML String | HTML string to be scraped. Use this if you already have the HTML content and do not need to fetch it from a live website. |
| Website | Website to be scraped. Provide a full URL; the node will fetch the HTML content from this address. |
| Selectors Input Mode | Choose how to provide selectors: - Expression: Supply selectors as a JSON array. - Manual: Add selectors one by one via UI fields. |
| Selectors (Expression) | Array of selectors to search for (JSON array). Used when "Selectors Input Mode" is set to "Expression". |
| Selectors (Manual) | List of selector entries, each with: • Selector: The CSS selector to search for. • Attribute: The attribute to return (e.g., href, src, text). • Key Field: The field name for the extracted value. |
Output
- The output is a JSON object containing the extracted data based on the provided selectors.
- Each key in the output corresponds to the "Key Field" specified in the selector configuration, and its value is the extracted content (attribute value or text) from the matched element(s).
- If multiple selectors are used, the output will include multiple fields accordingly.
Example output:
{
"title": "Example Page Title",
"mainLink": "https://example.com",
"imageSrc": "https://example.com/image.jpg"
}
- The node does not output binary data for this operation.
Dependencies
- External Service: Requires access to the 1001fx API.
- API Key: You must configure the
1001fxApicredential in n8n. - Network Access: The n8n instance must be able to reach external URLs if scraping live websites.
Troubleshooting
Common issues:
- Invalid Selectors: If a selector does not match any elements, the corresponding field may be empty or missing in the output.
- Malformed HTML: Supplying invalid HTML in the "HTML String" property can result in incomplete or incorrect extraction.
- Network Errors: When scraping a website, network issues or inaccessible URLs will cause errors.
- Authentication Required: Scraping protected or login-required pages will fail unless proper authentication is handled upstream.
Error messages:
"error": "Request failed with status code 404"– The target website was not found. Check the URL."error": "Invalid JSON in selectors"– The selectors input is not valid JSON. Double-check your input format."error": "Missing required parameter"– Ensure all required properties are filled.
Resolution tips:
- Always test your selectors using browser dev tools before using them in the node.
- For large or complex pages, consider limiting the number of selectors or refining them for better performance.