Package org.htmlunit.html
Class DomNodeUtil
- java.lang.Object
-
- org.htmlunit.html.DomNodeUtil
-
public class DomNodeUtil extends Object
DomNode
helper methods.- Author:
- tom.fennelly@gmail.com
-
-
Constructor Summary
Constructors Constructor Description DomNodeUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <E> List<E>
selectNodes(org.htmlunit.html.DomNode domNode, String xpathExpr)
Evaluates an XPath expression from the specified node, returning the resultant nodes.static <X> X
selectSingleNode(org.htmlunit.html.DomNode domNode, String xpathExpr)
Evaluates the specified XPath expression from this node, returning the first matching element, ornull
if no node matches the specified XPath expression.
-
-
-
Method Detail
-
selectNodes
public static <E> List<E> selectNodes(org.htmlunit.html.DomNode domNode, String xpathExpr)
Evaluates an XPath expression from the specified node, returning the resultant nodes.Calls
WebClientUtil.waitForJSExec(WebClient)
before executing the query.- Parameters:
domNode
- the node to start searching fromxpathExpr
- the XPath expression- Returns:
- the list of objects found.
-
selectSingleNode
public static <X> X selectSingleNode(org.htmlunit.html.DomNode domNode, String xpathExpr)
Evaluates the specified XPath expression from this node, returning the first matching element, ornull
if no node matches the specified XPath expression.Calls
WebClientUtil.waitForJSExec(WebClient)
before executing the query.- Parameters:
domNode
- the node to start searching fromxpathExpr
- the XPath expression- Returns:
- the first element matching the specified XPath expression
-
-