Web Scraper (DOM Parser)
The robomotion domparser CLI parses and extracts data from HTML web pages. It loads HTML content, queries elements using CSS selectors or XPath, extracts text and attributes, and outputs structured data from web pages.
When to use
- Extract data from HTML pages using CSS selectors
- Query DOM elements with XPath expressions
- Parse HTML content and extract text or attributes
Prerequisites
robomotionCLI installed- Package installed:
robomotion install domparser - No external credentials needed — works with HTML content/URLs
Workflow
- Install:
robomotion install domparser - Load HTML:
robomotion domparser load --url <url>or--html <content> - Extract:
robomotion domparser query --selector <css>or--xpath <xpath>
Commands Reference
robomotion domparser dom_find_element --html --css-selector [--contains-filter] [--exclude-filter] [--index] --output jsonFind a single HTML element using CSS selectorrobomotion domparser dom_find_all_elements --html --css-selector [--contains-filter] [--exclude-filter] [--limit] [--offset] --output jsonFind all HTML elements matching a CSS selectorrobomotion domparser dom_get_value --element --css-selector --attribute-name --output jsonExtract text content or attribute value from an HTML elementrobomotion domparser dom_get_values --elements --css-selector --attribute-name --output jsonExtract text or attribute values from multiple HTML elementsrobomotion domparser dom_extract_text --element [--separator] --output jsonExtract all text content from an HTML elementrobomotion domparser dom_extract_table --element [--header-row] [--skip-rows] --output jsonExtract HTML table data as JSON with columns and rowsrobomotion domparser dom_extract_images --element [--filter-extension] --output jsonExtract all image URLs from an HTML elementrobomotion domparser dom_count_words --text [--min-word-length] [--max-results] [--stop-words] --output jsonCalculate word frequency statistics from textrobomotion domparser dom_unescape_html --unescape-string --output jsonUnescape HTML entities in a stringrobomotion domparser dom_escape_html --escape-string --output jsonEscape special HTML characters in a string
Environment
- ROBOMOTION_API_TOKEN (if vault credentials are needed)