DOM.requestChildNodesRequests that children of the node with given id are returned to the caller in form of `setChildNodes` events where not only immediate children are retrieved, but all children down to the specified depth.
| Name | Type | Description |
|---|---|---|
nodeId | NodeId | Id of the node to get children for. |
depth (optional) | integer | The maximum depth at which children should be retrieved, defaults to 1. Use -1 for the entire subtree or provide an integer larger than 0. |
pierce (optional) | boolean | Whether or not iframes and shadow roots should be traversed when returning the sub-tree (default is false). |
{
"id": 1,
"method": "DOM.requestChildNodes",
"params": {
"nodeId": 1
}
}
{
"id": 1,
"result": {}
}
const result = await send('DOM.requestChildNodes', {"nodeId": 1});
console.log(result);