-
public final class DOMExtensionsKt
-
-
Method Summary
Modifier and Type Method Description final NodegetDocumentRoot(DOMDomain $self)Retrieves the root Node of the current document. final IntegergetDocumentRootNodeId(DOMDomain $self)Retrieves the ID of the root node of the current document. final IntegerfindNodeBySelector(DOMDomain $self, String selector)Retrieves the ID of the node corresponding to the given selector, or null if not found. final IntegerawaitNodeBySelector(DOMDomain $self, String selector, Duration pollingPeriod)Retrieves the ID of the node corresponding to the given selector, and retries until there is a match using the given pollingPeriod. final IntegergetNodeBySelector(DOMDomain $self, String selector)Retrieves the ID of the node corresponding to the given selector, or throw an exception if not found. final UnitfocusNodeBySelector(DOMDomain $self, String selector)Moves the focus to the node corresponding to the given selector, or null if not found. final DOMAttributesgetAttributes(DOMDomain $self, String nodeSelector)Gets the attributes of the node corresponding to the given nodeSelector, or null if the selector didn't match any node. final DOMAttributesgetAttributes(DOMDomain $self, Integer nodeId)Gets the attributes of the node corresponding to the given nodeId. final StringgetAttributeValue(DOMDomain $self, String nodeSelector, String attributeName)Gets the value of the attribute attributeName of the node corresponding to the given nodeSelector, or null if the selector didn't match any node or if the attribute was not present on the node. final StringgetAttributeValue(DOMDomain $self, Integer nodeId, String attributeName)Gets the value of the attribute attributeName of the node corresponding to the given nodeId, or null if the attribute was not present on the node. final UnitsetAttributeValue(DOMDomain $self, String nodeSelector, String name, String value)Sets the attribute of the given name to the given value on the node corresponding to the given nodeSelector. final UnitsetAttributeValue(DOMDomain $self, Integer nodeId, String name, String value)Sets the attribute of the given name to the given value on the node corresponding to the given nodeId. final BoxModelgetBoxModel(DOMDomain $self, String selector)Returns boxes for the node corresponding to the given selector, or null if the selector didn't match any node. final BoxModelgetBoxModel(DOMDomain $self, Integer nodeId)Returns boxes for the node corresponding to the given nodeId. -
-
Method Detail
-
getDocumentRoot
final Node getDocumentRoot(DOMDomain $self)
Retrieves the root Node of the current document.
-
getDocumentRootNodeId
final Integer getDocumentRootNodeId(DOMDomain $self)
Retrieves the ID of the root node of the current document.
-
findNodeBySelector
final Integer findNodeBySelector(DOMDomain $self, String selector)
Retrieves the ID of the node corresponding to the given selector, or null if not found.
Note that the returned NodeId cannot really be used to retrieve actual node information, and this is apparently by design of the DOM domain. It can be used to perform other CDP commands that require a NodeId, though.
-
awaitNodeBySelector
final Integer awaitNodeBySelector(DOMDomain $self, String selector, Duration pollingPeriod)
Retrieves the ID of the node corresponding to the given selector, and retries until there is a match using the given pollingPeriod.
This method may suspend forever if the selector never matches any node. The caller is responsible for using withTimeout or similar cancellation mechanisms around calls to this method if handling this case is necessary.
Note that the returned NodeId cannot really be used to retrieve actual node information, and this is apparently by design of the DOM domain. It can be used to perform other CDP commands that require a NodeId, though.
-
getNodeBySelector
final Integer getNodeBySelector(DOMDomain $self, String selector)
Retrieves the ID of the node corresponding to the given selector, or throw an exception if not found.
Note that the returned NodeId cannot really be used to retrieve actual node information, and this is apparently by design of the DOM domain. It can be used to perform other CDP commands that require a NodeId, though.
-
focusNodeBySelector
final Unit focusNodeBySelector(DOMDomain $self, String selector)
Moves the focus to the node corresponding to the given selector, or null if not found.
-
getAttributes
final DOMAttributes getAttributes(DOMDomain $self, String nodeSelector)
Gets the attributes of the node corresponding to the given nodeSelector, or null if the selector didn't match any node.
-
getAttributes
final DOMAttributes getAttributes(DOMDomain $self, Integer nodeId)
Gets the attributes of the node corresponding to the given nodeId.
-
getAttributeValue
final String getAttributeValue(DOMDomain $self, String nodeSelector, String attributeName)
Gets the value of the attribute attributeName of the node corresponding to the given nodeSelector, or null if the selector didn't match any node or if the attribute was not present on the node.
-
getAttributeValue
final String getAttributeValue(DOMDomain $self, Integer nodeId, String attributeName)
Gets the value of the attribute attributeName of the node corresponding to the given nodeId, or null if the attribute was not present on the node.
-
setAttributeValue
final Unit setAttributeValue(DOMDomain $self, String nodeSelector, String name, String value)
Sets the attribute of the given name to the given value on the node corresponding to the given nodeSelector. Throws an exception if the selector didn't match any node.
-
setAttributeValue
final Unit setAttributeValue(DOMDomain $self, Integer nodeId, String name, String value)
Sets the attribute of the given name to the given value on the node corresponding to the given nodeId.
-
getBoxModel
final BoxModel getBoxModel(DOMDomain $self, String selector)
Returns boxes for the node corresponding to the given selector, or null if the selector didn't match any node.
-
getBoxModel
final BoxModel getBoxModel(DOMDomain $self, Integer nodeId)
Returns boxes for the node corresponding to the given nodeId.
-
-
-
-