Modifier and Type | Method and Description |
---|---|
Elements |
findEach(String query)
Searches descendant elements and retrieves elements that were found to match the query, however for every matching element is found, the search does not continue into that element's descendants.
|
Elements |
findEvery(String query) |
Element |
findFirst(String query)
Searches all descendant elements and retrieves the first one found to match the query.
|
Elements |
getEach(String query)
Searches child elements (not all descendants) and retrieves those that
were found to match the query.
|
Element |
getElement(int index)
Returns the element at the specified index.
|
Element |
getFirst(String query)
Searches only child elements (not all descendants) and retrieves the first child element that was found to match the query.
|
String |
innerHTML()
Returns a String representation of the container and its child elements as HTML, where the container itself is represented as an element who's tagName is #elements.
|
String |
innerHTML(int indent) |
Iterator<Element> |
iterator()
Returns an iterator over the child Elements.
|
String |
outerHTML()
Returns a String representation of the child elements as HTML.
|
String |
outerHTML(int indent) |
int |
size()
Returns the number of child Elements.
|
List<Element> |
toList()
Returns the child Elements as a List.
|
String |
toString()
Returns a partial HTML representation of this container and its children (not including descendants)
|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
forEach, spliterator
public Elements findEach(String query)
query
- a query that has the general form <tagnameRegex attributeName="attributeValueRegex">childTextRegex
where multiple attributes are allowed. In order for the query to match against an element, the tagnameRegex, attribute name, attributeValueRegex and immediateTextRegex must match if they are specified.Matcher.find()
.public Elements getEach(String query)
query
- a query that has the general form
<tagnameRegex attributeName="attributeValueRegex">childTextRegex
where multiple attributes are allowed. In order for the query to
match against an element, the tagnameRegex, attribute name,
attributeValueRegex and immediateTextRegex must match if they are
specified.Matcher.find()
.public Element findFirst(String query) throws Exception
query
- a query that has the general form <tagnameRegex attributeName="attributeValueRegex">childTextRegex
where multiple attributes are allowed. In order for the query to match against an element, the tagnameRegex, attribute name, attributeValueRegex and immediateTextRegex must match if they are specified.Matcher.find()
.Exception
public Element getFirst(String query) throws Exception
query
- a query that has the general form <tagnameRegex attributeName="attributeValueRegex">childTextRegex
where multiple attributes are allowed. In order for the query to match against an element, the tagnameRegex, attribute name, attributeValueRegex and immediateTextRegex must match if they are specified.Matcher.find()
.Exception
public List<Element> toList()
public int size()
public String innerHTML()
public String innerHTML(int indent)
public String outerHTML()
public String outerHTML(int indent)
public Element getElement(int index) throws IndexOutOfBoundsException
index
- the index of the child element to be returned, where the first child has an index of 0.IndexOutOfBoundsException