public class JsoupUtils
extends java.lang.Object
| 构造器和说明 |
|---|
JsoupUtils() |
| 限定符和类型 | 方法和说明 |
|---|---|
static org.jsoup.select.Elements |
children(org.jsoup.nodes.Element parent,
java.lang.String... tags)
选取指定标签的子元素
|
static org.jsoup.select.Elements |
children(org.jsoup.nodes.Element parent,
java.lang.String tag)
选取指定标签的子元素
|
static org.jsoup.select.Elements |
childRows(org.jsoup.nodes.Element parent)
选取表格的所有行元素
|
static org.jsoup.nodes.Element |
firstChild(org.jsoup.nodes.Element parent,
java.lang.String tag)
选取第一个指定标签的子元素
|
static org.jsoup.nodes.Document |
parse(java.lang.String html) |
static void |
selectChildren(org.jsoup.select.Elements collection,
org.jsoup.nodes.Element parent,
java.util.function.Predicate<org.jsoup.nodes.Element> predicate)
选取符合条件的子元素到目标集合中
|
public static void selectChildren(org.jsoup.select.Elements collection,
org.jsoup.nodes.Element parent,
java.util.function.Predicate<org.jsoup.nodes.Element> predicate)
collection - 目标集合parent - 父元素predicate - 条件public static org.jsoup.select.Elements children(org.jsoup.nodes.Element parent,
java.lang.String tag)
parent - 父元素tag - 标签名称,小写public static org.jsoup.select.Elements children(org.jsoup.nodes.Element parent,
java.lang.String... tags)
parent - 父元素tags - 多种标签名称,小写public static org.jsoup.nodes.Element firstChild(org.jsoup.nodes.Element parent,
java.lang.String tag)
parent - 父元素tag - 标签名称,小写public static org.jsoup.select.Elements childRows(org.jsoup.nodes.Element parent)
parent - 表格元素public static org.jsoup.nodes.Document parse(java.lang.String html)
Jsoup.parseBodyFragment(String),
Parser.parseBodyFragment(String, String)