getElementHierarchy
Retrieve the hierarchical structure of webpage elements, including parent-child relationships, using CSS selectors. Optional parameters allow including text content, attributes, and setting depth for detailed web analysis.
Instructions
Get the hierarchical structure of page elements with parent-child relationships
Input Schema
Name | Required | Description | Default |
---|---|---|---|
includeAttributes | No | Include element attributes (default: false) | |
includeText | No | Include text content of elements (default: false) | |
maxDepth | No | Maximum depth to traverse (-1 for unlimited, default: 3) | |
selector | No | CSS selector for root element (default: 'body') |
Input Schema (JSON Schema)
{
"properties": {
"includeAttributes": {
"description": "Include element attributes (default: false)",
"type": "boolean"
},
"includeText": {
"description": "Include text content of elements (default: false)",
"type": "boolean"
},
"maxDepth": {
"description": "Maximum depth to traverse (-1 for unlimited, default: 3)",
"type": "number"
},
"selector": {
"description": "CSS selector for root element (default: 'body')",
"type": "string"
}
},
"required": [],
"type": "object"
}