Uses of Class
org.jsoup.nodes.Element
Packages that use Element
Package
Description
Contains example programs and use of jsoup.
Package containing classes supporting the core jsoup code.
HTML document structure nodes.
Contains the HTML parser, tag specifications, and HTML tokeniser.
Contains the jsoup HTML cleaner, and safelist definitions.
Packages to support the CSS-style element selector.
-
Uses of Element in org.jsoup.examples
Methods in org.jsoup.examples with parameters of type ElementModifier and TypeMethodDescriptionHtmlToPlainText.getPlainText(Element element) Format an Element to plain-text -
Uses of Element in org.jsoup.helper
Fields in org.jsoup.helper declared as ElementMethods in org.jsoup.helper with parameters of type ElementModifier and TypeMethodDescriptionvoidConverts a jsoup element into the provided W3C Document.Convert a jsoup DOM to a W3C Document.private StringW3CDom.W3CBuilder.updateNamespaces(Element el) Finds any namespaces defined in this element. -
Uses of Element in org.jsoup.nodes
Subclasses of Element in org.jsoup.nodesModifier and TypeClassDescriptionclassA HTML Document.classA HTML Form Element provides ready access to the form fields/controls that are associated with it.classFields in org.jsoup.nodes declared as ElementFields in org.jsoup.nodes with type parameters of type ElementModifier and TypeFieldDescriptionElement.EmptyChildrenprivate WeakReference<List<Element>> Element.shadowChildrenRefMethods in org.jsoup.nodes with type parameters of type ElementModifier and TypeMethodDescriptionprivate static <E extends Element>
intElement.indexInList(Element search, List<E> elements) Methods in org.jsoup.nodes that return ElementModifier and TypeMethodDescriptionAdd a class name to this element'sclassattribute.Insert the specified HTML into the DOM after this element (as a following sibling).Insert the specified node into the DOM after this node (as a following sibling).Add inner HTML to this element.Element.appendChild(Node child) Insert a node to the end of this Element's children.Element.appendChildren(Collection<? extends Node> children) Insert the given nodes to the end of this Element's children.Element.appendElement(String tagName) Create a new element by tag name, and add it as this Element's last child.Element.appendElement(String tagName, String namespace) Create a new element by tag name and namespace, add it as this Element's last child.Element.appendText(String text) Create and append a new TextNode to this element.Add this element to the supplied parent element, as its next child.Set a boolean attribute value on this element.Set an attribute value on this element.Insert the specified HTML into the DOM before this element (as a preceding sibling).Insert the specified node into the DOM before this node (as a preceding sibling).Document.body()Get this document's<body>or<frameset>element.Element.child(int index) Get a child element of this element, by its 0-based index number.Element.classNames(Set<String> classNames) Set the element'sclassattribute to the supplied class names.Element.clearAttributes()Element.clone()Find the closest element up the tree of parents that matches the specified CSS query.Find the closest element up the tree of parents that matches the specified evaluator.Document.createElement(String tagName) Create a new Element, with this document's base uri.protected ElementElement.empty()Remove all the element's child nodes.Element.expectFirst(String cssQuery) Just likeselectFirst(String), but if there is no match, throws anIllegalArgumentException.Element.filter(NodeFilter nodeFilter) Element.firstElementChild()Gets the first child of this Element that is an Element, ornullif there is none.Element.firstElementSibling()Gets the first Element sibling of this element.Deprecated.Element.forEachNode(Consumer<? super Node> action) private ElementNode.getDeepChild(Element el) Element.getElementById(String id) Find an element by ID, including or under this element.Document.head()Get this document'sheadelement.Set this element's inner HTML.private ElementDocument.htmlEl()Find the root HTML element, or create it if it doesn't exist.Set theidattribute 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.Element.lastElementChild()Gets the last child of this Element that is an Element, or @{code null} if there is none.Element.lastElementSibling()Gets the last element sibling of this element.Element.nextElementSibling()Gets the next sibling element of this element.final ElementElement.parent()Add inner HTML into this element.Element.prependChild(Node child) Add a node to the start of this element's children.Element.prependChildren(Collection<? extends Node> children) Insert the given nodes to the start of this Element's children.Element.prependElement(String tagName) Create a new element by tag name, and add it as this Element's first child.Element.prependElement(String tagName, String namespace) Create a new element by tag name and namespace, and add it as this Element's first child.Element.prependText(String text) Create and prepend a new TextNode to this element.Element.previousElementSibling()Gets the previous element sibling of this element.Element.removeAttr(String attributeKey) Element.removeClass(String className) Remove a class name from this element'sclassattribute.Element.root()Element.selectFirst(String cssQuery) Find the first Element that matches theSelectorCSS query, with this element as the starting context.Element.selectFirst(Evaluator evaluator) Finds the first Element that matches the supplied Evaluator, with this element as the starting context, ornullif none match.Element.shallowClone()Change (rename) the tag of this element.Change (rename) the tag of this element.Set the text of thebodyof this document.Set the text of this element.Element.toggleClass(String className) Toggle a class name on this element'sclassattribute: if present, remove it; otherwise add it.Element.traverse(NodeVisitor nodeVisitor) Set the value of a form element (input, textarea, etc).Wrap the supplied HTML around this element.Methods in org.jsoup.nodes that return types with arguments of type ElementModifier and TypeMethodDescriptionElement.childElementsList()Maintains a shadow copy of this element's child elements.Element.stream()Returns a Stream of this Element and all of its descendant Elements.Methods in org.jsoup.nodes with parameters of type ElementModifier and TypeMethodDescriptionFormElement.addElement(Element element) Add a form control element to this form.Add this element to the supplied parent element, as its next child.private ElementNode.getDeepChild(Element el) private static <E extends Element>
intElement.indexInList(Element search, List<E> elements) private static StringElement.searchUpForAttribute(Element start, String key) NodeUtils.selectXpath(String xpath, Element el, Class<T> nodeType) This impl works by compiling the input xpath expression, and then evaluating it against a W3C Document converted from the original jsoup element.Method parameters in org.jsoup.nodes with type arguments of type ElementConstructors in org.jsoup.nodes with parameters of type Element -
Uses of Element in org.jsoup.parser
Fields in org.jsoup.parser declared as ElementModifier and TypeFieldDescriptionprivate ElementHtmlTreeBuilder.contextElementprivate ElementHtmlTreeBuilder.headElementFields in org.jsoup.parser with type parameters of type ElementMethods in org.jsoup.parser that return ElementModifier and TypeMethodDescription(package private) ElementHtmlTreeBuilder.aboveOnStack(Element el) (package private) ElementHtmlTreeBuilder.createElementFor(Token.StartTag startTag, String namespace, boolean forcePreserveCase) (package private) ElementTreeBuilder.currentElement()Get the current element (last on the stack).(package private) ElementHtmlTreeBuilder.getActiveFormattingElement(String nodeName) (package private) ElementHtmlTreeBuilder.getFromStack(String elName) Gets the nearest (lowest) HTML element with the given name from the stack.(package private) ElementHtmlTreeBuilder.getHeadElement()(package private) ElementHtmlTreeBuilder.insertElementFor(Token.StartTag startTag) Inserts an HTML element for the given tag)(package private) ElementHtmlTreeBuilder.insertEmptyElementFor(Token.StartTag startTag) (package private) ElementHtmlTreeBuilder.insertForeignElementFor(Token.StartTag startTag, String namespace) Inserts a foreign element.(package private) ElementHtmlTreeBuilder.lastFormattingElement()(package private) final ElementTreeBuilder.pop()Removes the last Element from the stack, hits onNodeClosed, and then returns it.(package private) ElementHtmlTreeBuilder.popStackToClose(String elName) Pops the stack until the given HTML element is removed.(package private) ElementHtmlTreeBuilder.popStackToCloseAnyNamespace(String elName) Pops the stack until an element with the supplied name is removed, irrespective of namespace.(package private) ElementHtmlTreeBuilder.removeLastFormattingElement()Methods in org.jsoup.parser that return types with arguments of type ElementMethods in org.jsoup.parser with parameters of type ElementModifier and TypeMethodDescription(package private) ElementHtmlTreeBuilder.aboveOnStack(Element el) (package private) voidHtmlTreeBuilder.checkActiveFormattingElements(Element in) private voidHtmlTreeBuilder.doInsertElement(Element el, Token token) Inserts the Element onto the stack.(package private) voidHtmlTreeBuilder.insertCharacterToElement(Token.Character characterToken, Element el) Inserts the provided character token into the provided element.(package private) voidHtmlTreeBuilder.insertOnStackAfter(Element after, Element in) (package private) static booleanHtmlTreeBuilder.isHtmlIntegration(Element el) (package private) booleanHtmlTreeBuilder.isInActiveFormattingElements(Element el) (package private) static booleanHtmlTreeBuilder.isMathmlTextIntegration(Element el) private static booleanHtmlTreeBuilder.isSameFormattingElement(Element a, Element b) (package private) static boolean(package private) voidHtmlTreeBuilder.maybeSetBaseUri(Element base) private static boolean(package private) booleanHtmlTreeBuilder.parseFragment(String inputFragment, Element context, String baseUri, Parser parser) Parser.parseFragment(String fragmentHtml, Element context, String baseUri) Parse a fragment of HTML into a list of nodes.Parser.parseFragment(String fragmentHtml, Element context, String baseUri, ParseErrorList errorList) Parse a fragment of HTML into a list of nodes.TreeBuilder.parseFragment(String inputFragment, Element context, String baseUri, Parser parser) XmlTreeBuilder.parseFragment(String inputFragment, Element context, String baseUri, Parser parser) Parser.parseFragmentInput(String fragment, Element context, String baseUri) (package private) intHtmlTreeBuilder.positionOfElement(Element el) (package private) final voidAdds the specified Element to the end of the stack, and hits onNodeInserted.(package private) voidHtmlTreeBuilder.pushActiveFormattingElements(Element in) (package private) voidHtmlTreeBuilder.pushWithBookmark(Element in, int bookmark) (package private) voidHtmlTreeBuilder.removeFromActiveFormattingElements(Element el) (package private) booleanHtmlTreeBuilder.removeFromStack(Element el) (package private) voidHtmlTreeBuilder.replaceActiveFormattingElement(Element out, Element in) private static voidHtmlTreeBuilder.replaceInQueue(ArrayList<Element> queue, Element out, Element in) (package private) voidHtmlTreeBuilder.replaceOnStack(Element out, Element in) (package private) voidHtmlTreeBuilder.setHeadElement(Element headElement) Method parameters in org.jsoup.parser with type arguments of type Element -
Uses of Element in org.jsoup.safety
Fields in org.jsoup.safety declared as ElementModifier and TypeFieldDescriptionprivate ElementCleaner.CleaningVisitor.destination(package private) ElementCleaner.ElementMeta.elprivate final ElementCleaner.CleaningVisitor.rootMethods in org.jsoup.safety with parameters of type ElementModifier and TypeMethodDescriptionprivate intCleaner.copySafeNodes(Element source, Element dest) private Cleaner.ElementMetaCleaner.createSafeElement(Element sourceEl) booleanSafelist.isSafeAttribute(String tagName, Element el, Attribute attr) Test if the supplied attribute is allowed by this safelist for this tag.private booleanSafelist.testValidProtocol(Element el, Attribute attr, Set<Safelist.Protocol> protocols) Constructors in org.jsoup.safety with parameters of type ElementModifierConstructorDescriptionprivateCleaningVisitor(Element root, Element destination) (package private)ElementMeta(Element el, int numAttribsDiscarded) -
Uses of Element in org.jsoup.select
Fields in org.jsoup.select with type parameters of type ElementModifier and TypeFieldDescription(package private) static final ThreadLocal<NodeIterator<Element>> StructuralEvaluator.Has.ThreadElementIter(package private) final ThreadLocal<IdentityHashMap<Element, IdentityHashMap<Element, Boolean>>> StructuralEvaluator.threadMemo(package private) final ThreadLocal<IdentityHashMap<Element, IdentityHashMap<Element, Boolean>>> StructuralEvaluator.threadMemoMethods in org.jsoup.select that return ElementModifier and TypeMethodDescriptionstatic ElementFinds the first Element that matches the Evaluator that descends from the root, and stops the query once that first match is found.Elements.first()Get the first matched element.Elements.last()Get the last matched element.Elements.remove(int index) Remove the Element at the specified index in this ist, and from the DOM.static ElementSelector.selectFirst(String cssQuery, Element root) Find the first element that matches the query.Replace the Element at the specified index in this list, and in the DOM.Methods in org.jsoup.select that return types with arguments of type ElementModifier and TypeMethodDescriptionEvaluator.asPredicate(Element root) Provides a Predicate for this Evaluator, matching the test Element.Methods in org.jsoup.select with parameters of type ElementModifier and TypeMethodDescriptionEvaluator.asPredicate(Element root) Provides a Predicate for this Evaluator, matching the test Element.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 ElementsBuild a list of elements, by visiting root and every descendant of root, and testing it against the evaluator.static ElementFinds the first Element that matches the Evaluator that descends from the root, and stops the query once that first match is found.booleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanabstract booleanTest if the element meets the evaluator's requirements.booleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanDeprecated.booleanbooleanbooleanbooleanbooleanbooleanboolean(package private) booleanStructuralEvaluator.memoMatches(Element root, Element element) static ElementsFind elements matching selector.static ElementsFind elements matching selector.static ElementSelector.selectFirst(String cssQuery, Element root) Find the first element that matches the query.Replace the Element at the specified index in this list, and in the DOM.Method parameters in org.jsoup.select with type arguments of type ElementModifier and TypeMethodDescription(package private) static ElementsSelector.filterOut(Collection<Element> elements, Collection<Element> outs) booleanRemove from the list, and from the DOM, all elements in this list that mach the given filter.voidElements.replaceAll(UnaryOperator<Element> operator) Replace each element in this list with the result of the operator, and update the DOM.static ElementsFind elements matching selector.Constructors in org.jsoup.select with parameters of type ElementConstructor parameters in org.jsoup.select with type arguments of type Element
stream().forEach(Consumer)instead.