Example usage for Java org.jsoup.nodes Element fields, constructors, methods, implement or subclass
The text is from its open source code.
Tag | tag |
List | childNodes |
Attributes | attributes |
String | baseUri |
Element(Tag tag, String baseUri) Create a new Element from a tag and a base URI. | |
Element(Tag tag, String baseUri, Attributes attributes) Create a new, standalone Element. |
String | absUrl(String attributeKey) Get an absolute URL from a URL attribute that may be relative (i.e. |
Element | addClass(String className) Add a class name to this element's class attribute. |
Element | after(String html) Insert the specified HTML into the DOM after this element (as a following sibling). |
Element | after(Node node) Insert the specified node into the DOM after this node (as a following sibling). |
Element | append(String html) Add inner HTML to this element. |
Element | appendChild(Node child) Add a node child node to this element. |
Element | appendElement(String tagName) Create a new element by tag name, and add it as the last child. |
Element | appendText(String text) Create and append a new TextNode to this element. |
String | attr(String attributeKey) Get an attribute's value by its key. |
Element | attr(String attributeKey, String attributeValue) Set an attribute value on this element. |
Element | attr(String attributeKey, boolean attributeValue) Set a boolean attribute value on this element. |
Element | before(String html) Insert the specified HTML into the DOM before this element (as a preceding sibling). |
Element | before(Node node) Insert the specified node into the DOM before this node (as a preceding sibling). |
Element | child(int index) Get a child element of this element, by its 0-based index number. |
Node | childNode(int index) Get a child node by its 0-based index. |
int | childNodeSize() |
Elements | children() Get this element's child elements. |
String | className() Gets the literal value of this element's "class" attribute, which may include multiple class names, space separated. |
Set | classNames() Get all of the element's class names. |
Element | clone() |
String | data() Get the combined data of this element. |
List | dataNodes() Get this element's child data nodes. |
Map | dataset() Get this element's HTML5 custom data attributes. |
int | elementSiblingIndex() Get the list index of this element in its element sibling list. |
boolean | equals(Object o) Check if this node is the same instance of another (object identity test). |
Element | firstElementSibling() Gets the first element sibling of this element. |
Elements | getAllElements() Find all elements under this element (including self, and children of children). |
Class> | getClass() Returns the runtime class of this Object . |
Element | getElementById(String id) Find an element by ID, including or under this element. |
Elements | getElementsByAttribute(String key) Find elements that have a named attribute set. |
Elements | getElementsByAttributeValue(String key, String value) Find elements that have an attribute with the specific value. |
Elements | getElementsByAttributeValueContaining(String key, String match) Find elements that have attributes whose value contains the match string. |
Elements | getElementsByAttributeValueMatching(String key, Pattern pattern) Find elements that have attributes whose values match the supplied regular expression. |
Elements | getElementsByAttributeValueMatching(String key, String regex) Find elements that have attributes whose values match the supplied regular expression. |
Elements | getElementsByAttributeValueStarting(String key, String valuePrefix) Find elements that have attributes that start with the value prefix. |
Elements | getElementsByClass(String className) Find elements that have this class, including or under this element. |
Elements | getElementsByTag(String tagName) Finds elements, including and recursively under this element, with the specified tag name. |
Elements | getElementsContainingOwnText(String searchText) Find elements that directly contain the specified string. |
Elements | getElementsContainingText(String searchText) Find elements that contain the specified string. |
Elements | getElementsMatchingText(Pattern pattern) Find elements whose text matches the supplied regular expression. |
Elements | getElementsMatchingText(String regex) Find elements whose text matches the supplied regular expression. |
boolean | hasAttr(String attributeKey) Test if this element has an attribute. |
boolean | hasClass(String className) Tests if this element has a class. |
boolean | hasText() Test if this element has any text content (that is not just whitespace). |
String | html() Retrieves the element's inner HTML. |
T | html(T appendable) |
Element | html(String html) Set this element's inner HTML. |
String | id() Get the id attribute of this element. |
Element | insertChildren(int index, Collection extends Node> children) Inserts the given child nodes into this element at the specified index. |
Element | insertChildren(int index, Node... children) Inserts the given child nodes into this element at the specified index. |
boolean | isBlock() Test if this element is a block-level element. |
Element | nextElementSibling() Gets the next sibling element of this element. |
Node | nextSibling() Get this node's next sibling. |
String | nodeName() |
String | outerHtml() Get the outer HTML of this node. |
Document | ownerDocument() Gets the Document associated with this Node. |
String | ownText() Gets the text owned by this element only; does not get the combined text of all children. |
Element | parent() |
Node | parentNode() Gets this node's parent node. |
Elements | parents() Get this element's parent and ancestors, up to the document root. |
Element | previousElementSibling() Gets the previous element sibling of this element. |
void | remove() Remove (delete) this node from the DOM tree. |
Node | removeAttr(String attributeKey) Remove an attribute from this element. |
void | replaceWith(Node in) Replace this node in the DOM with the supplied node. |
Elements | select(String cssQuery) Find elements that match the Selector CSS query, with this element as the starting context. |
void | setBaseUri(final String baseUri) Update the base URI of this node and all of its descendants. |
Elements | siblingElements() Get sibling elements. |
int | siblingIndex() Get the list index of this node in its node sibling list. |
String | tagName() Get the name of the tag for this element. |
Element | tagName(String tagName) Change the tag of this element. |
String | text() Gets the combined text of this element and all its children. |
Element | text(String text) Set the text of this element. |
List | textNodes() Get this element's child text nodes. |
String | toString() Gets this node's outer HTML. |
Node | traverse(NodeVisitor nodeVisitor) Perform a depth-first traversal through this node and its descendants. |
Node | unwrap() Removes this node from the DOM, and moves its children up into the node's parent. |
String | val() Get the value of a form element (input, textarea, etc). |
Element | val(String value) Set the value of a form element (input, textarea, etc). |
Element | wrap(String html) Wrap the supplied HTML around this element. |