Package | Description |
---|---|
org.jsoup.examples |
Contains example programs and use of jsoup.
|
org.jsoup.helper |
Package containing classes supporting the core jsoup code.
|
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.
|
Modifier and Type | Method and Description |
---|---|
void |
HtmlToPlainText.FormattingVisitor.head(Node node,
int depth) |
void |
HtmlToPlainText.FormattingVisitor.tail(Node node,
int depth) |
Modifier and Type | Method and Description |
---|---|
<T extends Node> |
W3CDom.sourceNodes(org.w3c.dom.NodeList nodeList,
java.lang.Class<T> nodeType)
Retrieves the original jsoup DOM nodes from a nodelist created by this convertor.
|
Modifier and Type | Method and Description |
---|---|
private void |
W3CDom.W3CBuilder.append(org.w3c.dom.Node append,
Node source) |
private void |
W3CDom.W3CBuilder.copyAttributes(Node source,
org.w3c.dom.Element el) |
void |
W3CDom.W3CBuilder.head(Node source,
int depth) |
void |
W3CDom.W3CBuilder.tail(Node source,
int depth) |
Modifier and Type | Class and Description |
---|---|
class |
CDataNode
A Character Data node, to support CDATA sections.
|
class |
Comment
A comment node.
|
class |
DataNode
A data node, for contents of style, script tags etc, where contents should not show in text().
|
class |
Document
A HTML Document.
|
class |
DocumentType
A
<!DOCTYPE> node. |
class |
Element
An HTML Element consists of a tag name, attributes, and child nodes (including text nodes and other elements).
|
class |
FormElement
A HTML Form Element provides ready access to the form fields/controls that are associated with it.
|
(package private) class |
LeafNode |
class |
PseudoTextElement
|
class |
TextNode
A text node.
|
class |
XmlDeclaration
An XML Declaration.
|
Modifier and Type | Field and Description |
---|---|
(package private) Node |
Node.parentNode |
Modifier and Type | Field and Description |
---|---|
(package private) java.util.List<Node> |
Element.childNodes |
(package private) static java.util.List<Node> |
Node.EmptyNodes |
Modifier and Type | Method and Description |
---|---|
<T extends Node> |
Element.selectXpath(java.lang.String xpath,
java.lang.Class<T> nodeType)
Find Nodes that match the supplied XPath expression.
|
(package private) static <T extends Node> |
NodeUtils.selectXpath(java.lang.String xpath,
Element el,
java.lang.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.
|
Modifier and Type | Method and Description |
---|---|
Node |
Node.after(Node node)
Insert the specified node into the DOM after this node (as a following sibling).
|
Node |
Node.after(java.lang.String html)
Insert the specified HTML into the DOM after this node (as a following sibling).
|
Node |
LeafNode.attr(java.lang.String key,
java.lang.String value) |
Node |
Node.attr(java.lang.String attributeKey,
java.lang.String attributeValue)
Set an attribute (key=value).
|
Node |
Node.before(Node node)
Insert the specified node into the DOM before this node (as a preceding sibling).
|
Node |
Node.before(java.lang.String html)
Insert the specified HTML into the DOM before this node (as a preceding sibling).
|
Node |
Node.childNode(int index)
Get a child node by its 0-based index.
|
protected Node[] |
Node.childNodesAsArray() |
Node |
Node.clearAttributes()
Clear (remove) each of the attributes in this node.
|
Node |
Node.clone()
Create a stand-alone, deep copy of this node, and all of its children.
|
protected Node |
Node.doClone(Node parent) |
Node |
LeafNode.empty() |
abstract Node |
Node.empty()
Delete all this node's children.
|
Node |
Node.filter(NodeFilter nodeFilter)
Perform a depth-first filtering through this node and its descendants.
|
Node |
Node.firstChild()
Gets the first child node of this node, or
null if there is none. |
Node |
Node.forEachNode(java.util.function.Consumer<? super Node> action)
Perform the supplied action on this Node and each of its descendants, during a depth-first traversal.
|
Node |
Node.forEachNode(Consumer<? super Node> action)
Deprecated.
Use
forEachNode(Consumer) instead. |
Node |
Node.lastChild()
Gets the last child node of this node, or
null if there is none. |
Node |
Node.nextSibling()
Get this node's next sibling.
|
Node |
Node.parent()
Gets this node's parent node.
|
Node |
Node.parentNode()
Gets this node's parent node.
|
Node |
Node.previousSibling()
Get this node's previous sibling.
|
Node |
LeafNode.removeAttr(java.lang.String key) |
Node |
Node.removeAttr(java.lang.String attributeKey)
Remove an attribute from this node.
|
Node |
Node.root()
Get this node's root node; that is, its topmost ancestor.
|
Node |
Node.shallowClone()
Create a stand-alone, shallow copy of this node.
|
Node |
Node.traverse(NodeVisitor nodeVisitor)
Perform a depth-first traversal through this node and its descendants.
|
Node |
Node.unwrap()
Removes this node from the DOM, and moves its children up into the node's parent.
|
Node |
Node.wrap(java.lang.String html)
Wrap the supplied HTML around this node.
|
Modifier and Type | Method and Description |
---|---|
java.util.List<Node> |
Node.childNodes()
Get this node's children.
|
java.util.List<Node> |
Node.childNodesCopy()
Returns a deep copy of this node's children.
|
protected java.util.List<Node> |
LeafNode.ensureChildNodes() |
protected abstract java.util.List<Node> |
Node.ensureChildNodes() |
protected java.util.List<Node> |
Element.ensureChildNodes() |
java.util.List<Node> |
Node.siblingNodes()
Retrieves this node's sibling nodes.
|
Modifier and Type | Method and Description |
---|---|
protected void |
Node.addChildren(int index,
Node... children) |
protected void |
Node.addChildren(Node... children) |
Node |
Node.after(Node node)
Insert the specified node into the DOM after this node (as a following sibling).
|
Element |
Element.after(Node node)
Insert the specified node into the DOM after this node (as a following sibling).
|
Element |
Element.appendChild(Node child)
Insert a node to the end of this Element's children.
|
private static void |
Element.appendWholeText(Node node,
java.lang.StringBuilder accum) |
Node |
Node.before(Node node)
Insert the specified node into the DOM before this node (as a preceding sibling).
|
Element |
Element.before(Node node)
Insert the specified node into the DOM before this node (as a preceding sibling).
|
protected LeafNode |
LeafNode.doClone(Node parent) |
protected Node |
Node.doClone(Node parent) |
protected Element |
Element.doClone(Node parent) |
void |
Node.OuterHtmlVisitor.head(Node node,
int depth) |
Element |
Element.insertChildren(int index,
Node... children)
Inserts the given child nodes into this element at the specified index.
|
(package private) static boolean |
Node.isNode(Node node,
java.lang.String normalName)
Test if this node is not null and has the supplied normal name.
|
(package private) static Range |
Range.of(Node node,
boolean start)
Retrieves the source range for a given Node.
|
(package private) static Document.OutputSettings |
NodeUtils.outputSettings(Node node)
Get the output setting for this node, or if this node has no document (or parent), retrieve the default output
settings
|
(package private) static Parser |
NodeUtils.parser(Node node)
Get the parser that was used to make this node, or the default HTML parser if it has no parent.
|
Element |
Element.prependChild(Node child)
Add a node to the start of this element's children.
|
(package private) static boolean |
Element.preserveWhitespace(Node node) |
protected void |
FormElement.removeChild(Node out) |
protected void |
Node.removeChild(Node out) |
protected void |
Node.reparentChild(Node child) |
protected void |
Node.replaceChild(Node out,
Node in) |
void |
Node.replaceWith(Node in)
Replace this node in the DOM with the supplied node.
|
protected void |
Node.setParentNode(Node parentNode) |
void |
Node.OuterHtmlVisitor.tail(Node node,
int depth) |
void |
Range.track(Node node,
boolean start)
Internal jsoup method, called by the TreeBuilder.
|
Modifier and Type | Method and Description |
---|---|
Element |
Element.appendChildren(java.util.Collection<? extends Node> children)
Insert the given nodes to the end of this Element's children.
|
Node |
Node.forEachNode(java.util.function.Consumer<? super Node> action)
Perform the supplied action on this Node and each of its descendants, during a depth-first traversal.
|
Node |
Node.forEachNode(Consumer<? super Node> action)
Deprecated.
Use
forEachNode(Consumer) instead. |
Element |
Element.forEachNode(java.util.function.Consumer<? super Node> action) |
Element |
Element.insertChildren(int index,
java.util.Collection<? extends Node> children)
Inserts the given child nodes into this element at the specified index.
|
Element |
Element.prependChildren(java.util.Collection<? extends Node> children)
Insert the given nodes to the start of this Element's children.
|
Modifier and Type | Method and Description |
---|---|
static java.util.List<Node> |
Parser.parseFragment(java.lang.String fragmentHtml,
Element context,
java.lang.String baseUri)
Parse a fragment of HTML into a list of nodes.
|
static java.util.List<Node> |
Parser.parseFragment(java.lang.String fragmentHtml,
Element context,
java.lang.String baseUri,
ParseErrorList errorList)
Parse a fragment of HTML into a list of nodes.
|
(package private) abstract java.util.List<Node> |
TreeBuilder.parseFragment(java.lang.String inputFragment,
Element context,
java.lang.String baseUri,
Parser parser) |
(package private) java.util.List<Node> |
HtmlTreeBuilder.parseFragment(java.lang.String inputFragment,
Element context,
java.lang.String baseUri,
Parser parser) |
(package private) java.util.List<Node> |
XmlTreeBuilder.parseFragment(java.lang.String inputFragment,
Element context,
java.lang.String baseUri,
Parser parser) |
(package private) java.util.List<Node> |
XmlTreeBuilder.parseFragment(java.lang.String inputFragment,
java.lang.String baseUri,
Parser parser) |
java.util.List<Node> |
Parser.parseFragmentInput(java.lang.String fragment,
Element context,
java.lang.String baseUri) |
static java.util.List<Node> |
Parser.parseXmlFragment(java.lang.String fragmentXml,
java.lang.String baseUri)
Parse a fragment of XML into a list of nodes.
|
Modifier and Type | Method and Description |
---|---|
(package private) void |
HtmlTreeBuilder.insertInFosterParent(Node in) |
protected void |
XmlTreeBuilder.insertNode(Node node) |
private void |
HtmlTreeBuilder.insertNode(Node node,
Token token)
Inserts the provided character token into the provided element.
|
protected void |
XmlTreeBuilder.insertNode(Node node,
Token token) |
protected void |
TreeBuilder.onNodeClosed(Node node,
Token token)
Called by implementing TreeBuilders when a node is explicitly closed.
|
protected void |
TreeBuilder.onNodeInserted(Node node,
Token token)
Called by implementing TreeBuilders when a node has been inserted.
|
private void |
TreeBuilder.trackNodePosition(Node node,
Token token,
boolean start) |
Modifier and Type | Method and Description |
---|---|
void |
Cleaner.CleaningVisitor.head(Node source,
int depth) |
void |
Cleaner.CleaningVisitor.tail(Node source,
int depth) |
Modifier and Type | Method and Description |
---|---|
private <T extends Node> |
Elements.childNodesOfType(java.lang.Class<T> tClass) |
Modifier and Type | Method and Description |
---|---|
static NodeFilter.FilterResult |
NodeTraversor.filter(NodeFilter filter,
Node root)
Start a depth-first filtering of the root and all of its descendants.
|
NodeFilter.FilterResult |
NodeFilter.head(Node node,
int depth)
Callback for when a node is first visited.
|
void |
NodeVisitor.head(Node node,
int depth)
Callback for when a node is first visited.
|
NodeFilter.FilterResult |
Collector.FirstFinder.head(Node node,
int depth) |
default NodeFilter.FilterResult |
NodeFilter.tail(Node node,
int depth)
Callback for when a node is last visited, after all of its descendants have been visited.
|
default void |
NodeVisitor.tail(Node node,
int depth)
Callback for when a node is last visited, after all of its descendants have been visited.
|
NodeFilter.FilterResult |
Collector.FirstFinder.tail(Node node,
int depth) |
static void |
NodeTraversor.traverse(NodeVisitor visitor,
Node root)
Start a depth-first traverse of the root and all of its descendants.
|