|
Node findCommonAncestor(Node node1, Node node2, Node topmost) |
|
Parameters |
node1 | The first node. |
node2 | The second node. |
topmost | The topmost node to stop the search. |
Returns | The common parent or null. |
|
Node getAncestorOfClass(String clazz) |
|
Parameters |
clazz | The parent's class name. |
Returns | The parent or null. |
|
Node getAncestorOfClass(String clazz, int maxDepth) |
|
Parameters |
clazz | The parent's class name. |
maxDepth | The maximum search level. |
Returns | The parent or null. |
|
String getAttribute(String name) |
|
Parameters |
name | The name of the attribute |
Returns |
The value of the attribute or null if no such attribute is available for the node.
|
|
String getAttributeIfSpecified(String name) |
|
Parameters |
name | The name of the attribute |
Returns |
The value of the attribute or null if no such attribute is explicitly specified for
the node.
|
|
Node getChild(int index) |
|
Parameters |
index | The index of the child node, starting with 0. |
Returns | The child node at the index. |
Throws |
IllegalArgumentException |
If index is negative or exceeds the number of child nodes.
|
|
int getChildCount() |
|
Returns | The number of child nodes. |
|
Node[] getChildren() |
|
Returns | The child nodes. |
|
String getClassName() |
|
Returns | The most current class name. |
|
String[] getClassNames() |
|
Returns | An array with all class names of that node. |
|
DocumentNode getDocument() |
|
Returns |
The document to which this node belongs. A DocumentNode will return
itself, a DialogNode will return null.
|
|
Node getElementById(String id) |
|
Parameters |
id | The ID to look for. |
Returns |
The child node with the given ID, an arbitrary one in case of multiple matches or
null if none is found. A DialogNode will always return null, a
FrameNode forwards the call to its DocumentNode child node
and a DocumentNode to its <HTML> root element.
|
|
Node[] getElementsByClassName(String className) |
|
Parameters |
className | The name of the class. |
Returns | An array of child nodes with the specified class name. If none are found, an empty array is
returned. |
|
Node[] getElementsById(String id) |
|
Parameters |
id | The ID to look for. |
Returns |
An array of child nodes with the given ID. If none are found, an empty
array is returned. A DialogNode will always return an empty array, a
FrameNode forwards the call to its DocumentNode child node
and a DocumentNode to its <HTML> root element.
|
|
Node[] getElementsByIdAndTagname(String id, String tagName) |
|
Parameters |
id | The ID to look for. |
tagName | The tag name to look for. |
Returns |
An array of child nodes with the given ID and the given tag name. If none
are found, an empty array is returned. A DialogNode will always return
an empty array, a FrameNode forwards the call to its
DocumentNode child node and a DocumentNode to its
<HTML> root element.
|
|
Node[] getElementsByTagName(String tagName) |
|
Parameters |
tagName | The tag name to look for. |
Returns |
An array of child nodes with the given tag name. If none are found, an empty array is
returned. A DialogNode will always return an empty array, a
FrameNode forwards the call to its DocumentNode child node
and a DocumentNode to its <HTML> root element.
|
|
Node getFirstChild() |
|
Returns | The first child node. |
|
Node getFirstElementChild() |
|
Returns | The first child element. |
|
String getFlatText() |
|
Returns |
The whole direct text content of a node.
|
|
String getGenericClassName() |
|
Returns | The generic class name. |
|
int getIndexOfChild(Node child) |
|
Parameters |
child | The child node to get the index for. |
Returns |
The index of the child node, starting with 0, or -1 in case it is not a child of the
this node.
|
|
Node getInterestingParent() |
|
Returns | The interesting parent of the node. |
|
Node getInterestingParent(int n) |
|
Parameters |
n | The interesting parent's level. |
Returns | The interesting parent of the node. |
|
String getName() |
|
Returns | The tag name of the node. |
|
Node getNextElementSibling() |
|
Returns | The next element sibling. |
|
Node getNextSibling() |
|
Returns | The next sibling. |
|
String getNodeType() |
|
Returns |
A string specifying the type of node. The respective constants are defined in the
concrete sub-classes: DocumentNode.DOCUMENT_NODE ,
FrameNode.FRAME_NODE , DomNode.DOM_NODE and
DialogNode.DIALOG_NODE .
|
|
Node getNthParent(int n) |
|
Parameters |
n | The parent's level. |
Returns | The n-th parent or null. |
|
Node getParent() |
|
Returns | The parent of the node. |
|
Node getPreviousElementSibling() |
|
Returns | The previous element sibling. |
|
Node getPreviousSibling() |
|
Returns | The previous sibling. |
|
Object getProperty(String name) |
|
Parameters |
name | The name of the property to retrieve. |
Returns | The value of the specified property or null. |
|
String getSimpleText() |
|
Returns | The simple text content of a node. |
|
String getText() |
|
Returns |
The whole direct and indirect text content of a node.
|
|
String getVisibleFlatText() |
|
Returns |
The whole direct visible text content of a node.
|
|
String getVisibleSimpleText() |
|
Returns | The visible simple text content of a node. |
|
String getVisibleText() |
|
Returns |
The whole direct and indirect visible text content of a node.
|
|
boolean isAncestor(Node node) |
|
Parameters |
node | The possible ancestor node. |
Returns | True, if node is an ancestor, otherwise false. |
|
boolean isAttributeSpecified(String name) |
|
Parameters |
name | The name of the attribute |
Returns |
True if an attribute is explicitly specified for the node.
|
|
boolean isBrowserChrome() |
|
Returns | True for Chrome derivatives, false otherwhise. |
|
boolean isBrowserHeadless() |
|
Returns | True for headless browser, false otherwhise. |
|
boolean isBrowserMozilla() |
|
Returns | True for Mozilla derivatives, false otherwhise. |
|
boolean isBrowserSafari() |
|
Returns | True for Safari, false otherwhise. |
|
boolean isMatchingClass(String className) |
|
Parameters |
className | The class name to check. |
Returns | True, if node matches this class, otherwise false. |
|
void setProperty(String name, Object value) |
|
Parameters |
name | The name of the property. |
value |
The property value or null to remove an existing property.
|
|
|