Uses of Class
org.jsoup.nodes.Element
| Package | Description |
|---|---|
| org.jsoup.examples |
Contains example programs and use of jsoup.
|
| org.jsoup.nodes |
HTML document structure nodes.
|
| org.jsoup.parser |
Contains the HTML parser, tag specifications, and HTML tokeniser.
|
| org.jsoup.safety |
Contains the jsoup HTML cleaner, and safelist definitions.
|
| org.jsoup.select |
Packages to support the CSS-style element selector.
|
-
Uses of Element in org.jsoup.examples
Methods in org.jsoup.examples with parameters of type Element Modifier and Type Method Description StringHtmlToPlainText. getPlainText(Element element)Format an Element to plain-text -
Uses of Element in org.jsoup.nodes
Subclasses of Element in org.jsoup.nodes Modifier and Type Class Description classDocumentA HTML Document.classFormElementA HTML Form Element provides ready access to the form fields/controls that are associated with it.classPseudoTextElementMethods in org.jsoup.nodes that return Element Modifier and Type Method Description ElementElement. addClass(String className)Add a class name to this element'sclassattribute.ElementElement. after(String html)Insert the specified HTML into the DOM after this element (as a following sibling).ElementElement. after(Node node)Insert the specified node into the DOM after this node (as a following sibling).ElementElement. append(String html)Add inner HTML to this element.ElementElement. appendChild(Node child)Insert a node to the end of this Element's children.ElementElement. appendChildren(Collection<? extends Node> children)Insert the given nodes to the end of this Element's children.ElementElement. appendElement(String tagName)Create a new element by tag name, and add it as the last child.ElementElement. appendText(String text)Create and append a new TextNode to this element.ElementElement. appendTo(Element parent)Add this element to the supplied parent element, as its next child.ElementElement. attr(String attributeKey, boolean attributeValue)Set a boolean attribute value on this element.ElementElement. attr(String attributeKey, String attributeValue)Set an attribute value on this element.ElementElement. before(String html)Insert the specified HTML into the DOM before this element (as a preceding sibling).ElementElement. before(Node node)Insert the specified node into the DOM before this node (as a preceding sibling).ElementDocument. body()Get this document's<body>or<frameset>element.ElementElement. child(int index)Get a child element of this element, by its 0-based index number.ElementElement. classNames(Set<String> classNames)Set the element'sclassattribute to the supplied class names.ElementElement. clearAttributes()ElementElement. clone()ElementElement. closest(String cssQuery)Find the closest element up the tree of parents that matches the specified CSS query.ElementElement. closest(Evaluator evaluator)Find the closest element up the tree of parents that matches the specified evaluator.ElementDocument. createElement(String tagName)Create a new Element, with this document's base uri.protected ElementElement. doClone(Node parent)ElementElement. empty()Remove all of the element's child nodes.ElementElement. filter(NodeFilter nodeFilter)ElementElement. firstElementSibling()Gets the first Element sibling of this element.ElementElement. getElementById(String id)Find an element by ID, including or under this element.ElementDocument. head()Get this document'sheadelement.ElementElement. html(String html)Set this element's inner HTML.ElementElement. id(String id)Set theidattribute of this element.ElementElement. insertChildren(int index, Collection<? extends Node> children)Inserts the given child nodes into this element at the specified index.ElementElement. insertChildren(int index, Node... children)Inserts the given child nodes into this element at the specified index.ElementElement. lastElementSibling()Gets the last element sibling of this element.ElementElement. nextElementSibling()Gets the next sibling element of this element.ElementElement. parent()ElementElement. prepend(String html)Add inner HTML into this element.ElementElement. prependChild(Node child)Add a node to the start of this element's children.ElementElement. prependChildren(Collection<? extends Node> children)Insert the given nodes to the start of this Element's children.ElementElement. prependElement(String tagName)Create a new element by tag name, and add it as the first child.ElementElement. prependText(String text)Create and prepend a new TextNode to this element.ElementElement. previousElementSibling()Gets the previous element sibling of this element.ElementElement. removeAttr(String attributeKey)ElementElement. removeClass(String className)Remove a class name from this element'sclassattribute.ElementElement. root()ElementElement. selectFirst(String cssQuery)Find the first Element that matches theSelectorCSS query, with this element as the starting context.ElementElement. selectFirst(Evaluator evaluator)Finds the first Element that matches the supplied Evaluator, with this element as the starting context, ornullif none match.ElementElement. shallowClone()ElementElement. tagName(String tagName)Change (rename) the tag of this element.ElementDocument. text(String text)Set the text of thebodyof this document.ElementElement. text(String text)Set the text of this element.ElementElement. toggleClass(String className)Toggle a class name on this element'sclassattribute: if present, remove it; otherwise add it.ElementElement. traverse(NodeVisitor nodeVisitor)ElementElement. val(String value)Set the value of a form element (input, textarea, etc).ElementElement. wrap(String html)Wrap the supplied HTML around this element.Methods in org.jsoup.nodes with parameters of type Element Modifier and Type Method Description FormElementFormElement. addElement(Element element)Add a form control element to this form.ElementElement. appendTo(Element parent)Add this element to the supplied parent element, as its next child. -
Uses of Element in org.jsoup.parser
Fields in org.jsoup.parser with type parameters of type Element Modifier and Type Field Description protected ArrayList<Element>TreeBuilder. stackprotected ArrayList<Element>TreeBuilder. stackMethods in org.jsoup.parser with parameters of type Element Modifier and Type Method Description static List<Node>Parser. parseFragment(String fragmentHtml, Element context, String baseUri)Parse a fragment of HTML into a list of nodes.static List<Node>Parser. parseFragment(String fragmentHtml, Element context, String baseUri, ParseErrorList errorList)Parse a fragment of HTML into a list of nodes.List<Node>Parser. parseFragmentInput(String fragment, Element context, String baseUri) -
Uses of Element in org.jsoup.safety
Methods in org.jsoup.safety with parameters of type Element Modifier and Type Method Description protected booleanSafelist. isSafeAttribute(String tagName, Element el, Attribute attr)Test if the supplied attribute is allowed by this safelist for this tagprotected booleanWhitelist. isSafeAttribute(String tagName, Element el, Attribute attr)Deprecated. -
Uses of Element in org.jsoup.select
Methods in org.jsoup.select that return Element Modifier and Type Method Description static ElementCollector. findFirst(Evaluator eval, Element root)Finds the first Element that matches the Evaluator that descends from the root, and stops the query once that first match is found.ElementElements. first()Get the first matched element.ElementElements. last()Get the last matched element.static ElementSelector. selectFirst(String cssQuery, Element root)Find the first element that matches the query.Methods in org.jsoup.select with parameters of type Element Modifier and Type Method Description protected abstract intEvaluator.CssNthEvaluator. calculatePosition(Element root, Element element)protected intEvaluator.IsNthChild. calculatePosition(Element root, Element element)protected intEvaluator.IsNthLastChild. calculatePosition(Element root, Element element)protected intEvaluator.IsNthLastOfType. calculatePosition(Element root, Element element)protected intEvaluator.IsNthOfType. calculatePosition(Element root, Element element)static ElementsCollector. collect(Evaluator eval, Element root)Build a list of elements, by visiting root and every descendant of root, and testing it against the evaluator.static ElementCollector. findFirst(Evaluator eval, Element root)Finds the first Element that matches the Evaluator that descends from the root, and stops the query once that first match is found.booleanEvaluator.AllElements. matches(Element root, Element element)booleanEvaluator.Attribute. matches(Element root, Element element)booleanEvaluator.AttributeStarting. matches(Element root, Element element)booleanEvaluator.AttributeWithValue. matches(Element root, Element element)booleanEvaluator.AttributeWithValueContaining. matches(Element root, Element element)booleanEvaluator.AttributeWithValueEnding. matches(Element root, Element element)booleanEvaluator.AttributeWithValueMatching. matches(Element root, Element element)booleanEvaluator.AttributeWithValueNot. matches(Element root, Element element)booleanEvaluator.AttributeWithValueStarting. matches(Element root, Element element)booleanEvaluator.Class. matches(Element root, Element element)booleanEvaluator.ContainsData. matches(Element root, Element element)booleanEvaluator.ContainsOwnText. matches(Element root, Element element)booleanEvaluator.ContainsText. matches(Element root, Element element)booleanEvaluator.CssNthEvaluator. matches(Element root, Element element)booleanEvaluator.Id. matches(Element root, Element element)booleanEvaluator.IndexEquals. matches(Element root, Element element)booleanEvaluator.IndexGreaterThan. matches(Element root, Element element)booleanEvaluator.IndexLessThan. matches(Element root, Element element)booleanEvaluator.IsEmpty. matches(Element root, Element element)booleanEvaluator.IsFirstChild. matches(Element root, Element element)booleanEvaluator.IsLastChild. matches(Element root, Element element)booleanEvaluator.IsOnlyChild. matches(Element root, Element element)booleanEvaluator.IsOnlyOfType. matches(Element root, Element element)booleanEvaluator.IsRoot. matches(Element root, Element element)abstract booleanEvaluator. matches(Element root, Element element)Test if the element meets the evaluator's requirements.booleanEvaluator.Matches. matches(Element root, Element element)booleanEvaluator.MatchesOwn. matches(Element root, Element element)booleanEvaluator.MatchText. matches(Element root, Element element)booleanEvaluator.Tag. matches(Element root, Element element)booleanEvaluator.TagEndsWith. matches(Element root, Element element)static ElementsSelector. select(String query, Element root)Find elements matching selector.static ElementsSelector. select(Evaluator evaluator, Element root)Find elements matching selector.static ElementSelector. selectFirst(String cssQuery, Element root)Find the first element that matches the query.Method parameters in org.jsoup.select with type arguments of type Element Modifier and Type Method Description static ElementsSelector. select(String query, Iterable<Element> roots)Find elements matching selector.Constructors in org.jsoup.select with parameters of type Element Constructor Description Elements(Element... elements)Constructor parameters in org.jsoup.select with type arguments of type Element Constructor Description Elements(Collection<Element> elements)Elements(List<Element> elements)