Generate Simplified DOM
Type: generate_simplified_dom
When you're looking at the DOM of a web page, there's a lot of unnecessary data that can be discarded if you are only interested in the page's elements or looking to export the data into an LLM.
The generate_simplified_dom output format processes the HTML in the following way:
Removes all links in the
headRemoves all
scriptnodes and links to scriptsRemoves all
stylenodesRemove
styleattributes from all elementsRemove all links to stylesheets
Remove all
noscriptelements outside of the bodyFinds all
hrefswith query strings and removes the query stringsImportant
metatags are kept, all others are removedRemove all
alternatelinksRemove all SVG paths
Remove empty text nodes and excessive spacing
Parameters
See universal parameters.
Usage
The following JSON captures the page's DOM and simplifies it.
Example Output
FAQs
When do I use generate_simplified_dom?
Use it when you need to understand a page's structure — usually to find selectors on a site you haven't scraped before, or to give an AI agent something to plan its next action from.
What does generate_simplified_dom remove?
It removes scripts, styles and style attributes, stylesheet and alternate links, noscript elements outside the body, SVG paths, most meta tags, query strings on links, and empty text.
When should I use capture_dom instead of generate_simplified_dom?
Use capture_dom when you need something simplification removes — inline scripts, style attributes or full link URLs. Use the simplified version for everything else.
When should I use generate_markdown instead of generate_simplified_dom?
Use generate_markdown when you only need the content. Use generate_simplified_dom when you need the structure too, like classes and IDs to build selectors from.
How can an AI agent find selectors on a page it doesn't know?
Run generate_simplified_dom first, look through the structure for stable IDs, classes or ARIA labels, then build click, type or capture_element actions from what you find.
Does generate_simplified_dom keep links?
Yes, but without their query strings. If you need full URLs with parameters, use capture_dom or capture_element instead.
Last updated