Java org.jsoup.nodes Element fields, constructors, methods, implement or subclass

Example usage for Java org.jsoup.nodes Element fields, constructors, methods, implement or subclass

Introduction

In this page you can find the methods, fields and constructors for org.jsoup.nodes Element.

The text is from its open source code.

Field

Tagtag
ListchildNodes
Attributesattributes
StringbaseUri

Constructor

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.

Method

StringabsUrl(String attributeKey)
Get an absolute URL from a URL attribute that may be relative (i.e.
ElementaddClass(String className)
Add a class name to this element's class attribute.
Elementafter(String html)
Insert the specified HTML into the DOM after this element (as a following sibling).
Elementafter(Node node)
Insert the specified node into the DOM after this node (as a following sibling).
Elementappend(String html)
Add inner HTML to this element.
ElementappendChild(Node child)
Add a node child node to this element.
ElementappendElement(String tagName)
Create a new element by tag name, and add it as the last child.
ElementappendText(String text)
Create and append a new TextNode to this element.
Stringattr(String attributeKey)
Get an attribute's value by its key.
Elementattr(String attributeKey, String attributeValue)
Set an attribute value on this element.
Elementattr(String attributeKey, boolean attributeValue)
Set a boolean attribute value on this element.
Elementbefore(String html)
Insert the specified HTML into the DOM before this element (as a preceding sibling).
Elementbefore(Node node)
Insert the specified node into the DOM before this node (as a preceding sibling).
Elementchild(int index)
Get a child element of this element, by its 0-based index number.
NodechildNode(int index)
Get a child node by its 0-based index.
intchildNodeSize()
Elementschildren()
Get this element's child elements.
StringclassName()
Gets the literal value of this element's "class" attribute, which may include multiple class names, space separated.
SetclassNames()
Get all of the element's class names.
Elementclone()
Stringdata()
Get the combined data of this element.
ListdataNodes()
Get this element's child data nodes.
Mapdataset()
Get this element's HTML5 custom data attributes.
intelementSiblingIndex()
Get the list index of this element in its element sibling list.
booleanequals(Object o)
Check if this node is the same instance of another (object identity test).
ElementfirstElementSibling()
Gets the first element sibling of this element.
ElementsgetAllElements()
Find all elements under this element (including self, and children of children).
ClassgetClass()
Returns the runtime class of this Object .
ElementgetElementById(String id)
Find an element by ID, including or under this element.
ElementsgetElementsByAttribute(String key)
Find elements that have a named attribute set.
ElementsgetElementsByAttributeValue(String key, String value)
Find elements that have an attribute with the specific value.
ElementsgetElementsByAttributeValueContaining(String key, String match)
Find elements that have attributes whose value contains the match string.
ElementsgetElementsByAttributeValueMatching(String key, Pattern pattern)
Find elements that have attributes whose values match the supplied regular expression.
ElementsgetElementsByAttributeValueMatching(String key, String regex)
Find elements that have attributes whose values match the supplied regular expression.
ElementsgetElementsByAttributeValueStarting(String key, String valuePrefix)
Find elements that have attributes that start with the value prefix.
ElementsgetElementsByClass(String className)
Find elements that have this class, including or under this element.
ElementsgetElementsByTag(String tagName)
Finds elements, including and recursively under this element, with the specified tag name.
ElementsgetElementsContainingOwnText(String searchText)
Find elements that directly contain the specified string.
ElementsgetElementsContainingText(String searchText)
Find elements that contain the specified string.
ElementsgetElementsMatchingText(Pattern pattern)
Find elements whose text matches the supplied regular expression.
ElementsgetElementsMatchingText(String regex)
Find elements whose text matches the supplied regular expression.
booleanhasAttr(String attributeKey)
Test if this element has an attribute.
booleanhasClass(String className)
Tests if this element has a class.
booleanhasText()
Test if this element has any text content (that is not just whitespace).
Stringhtml()
Retrieves the element's inner HTML.
Thtml(T appendable)
Elementhtml(String html)
Set this element's inner HTML.
Stringid()
Get the id attribute of this element.
ElementinsertChildren(int index, Collection children)
Inserts the given child nodes into this element at the specified index.
ElementinsertChildren(int index, Node... children)
Inserts the given child nodes into this element at the specified index.
booleanisBlock()
Test if this element is a block-level element.
ElementnextElementSibling()
Gets the next sibling element of this element.
NodenextSibling()
Get this node's next sibling.
StringnodeName()
StringouterHtml()
Get the outer HTML of this node.
DocumentownerDocument()
Gets the Document associated with this Node.
StringownText()
Gets the text owned by this element only; does not get the combined text of all children.
Elementparent()
NodeparentNode()
Gets this node's parent node.
Elementsparents()
Get this element's parent and ancestors, up to the document root.
ElementpreviousElementSibling()
Gets the previous element sibling of this element.
voidremove()
Remove (delete) this node from the DOM tree.
NoderemoveAttr(String attributeKey)
Remove an attribute from this element.
voidreplaceWith(Node in)
Replace this node in the DOM with the supplied node.
Elementsselect(String cssQuery)
Find elements that match the Selector CSS query, with this element as the starting context.
voidsetBaseUri(final String baseUri)
Update the base URI of this node and all of its descendants.
ElementssiblingElements()
Get sibling elements.
intsiblingIndex()
Get the list index of this node in its node sibling list.
StringtagName()
Get the name of the tag for this element.
ElementtagName(String tagName)
Change the tag of this element.
Stringtext()
Gets the combined text of this element and all its children.
Elementtext(String text)
Set the text of this element.
ListtextNodes()
Get this element's child text nodes.
StringtoString()
Gets this node's outer HTML.
Nodetraverse(NodeVisitor nodeVisitor)
Perform a depth-first traversal through this node and its descendants.
Nodeunwrap()
Removes this node from the DOM, and moves its children up into the node's parent.
Stringval()
Get the value of a form element (input, textarea, etc).
Elementval(String value)
Set the value of a form element (input, textarea, etc).
Elementwrap(String html)
Wrap the supplied HTML around this element.