← Back to DOM domain

DOM.describeNode

Describes node given its id, does not require domain to be enabled. Does not start tracking any objects, can be used for automation.

Domain: DOM stable

Parameters

NameTypeDescription
nodeId (optional)NodeIdIdentifier of the node.
backendNodeId (optional)BackendNodeIdIdentifier of the backend node.
objectId (optional)Runtime.RemoteObjectIdJavaScript object id of the node wrapper.
depth (optional)integerThe 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)booleanWhether or not iframes and shadow roots should be traversed when returning the subtree (default is false).

Returns

NameTypeDescription
nodeNodeNode description.

Example Request

{
  "id": 1,
  "method": "DOM.describeNode"
}

Example Response

{
  "id": 1,
  "result": {
    "node": "node-value"
  }
}

Usage in Node.js

const result = await send('DOM.describeNode');
console.log(result);
// {"node": "node-value"}