类 JsoupUtils

java.lang.Object
org.ddr.poi.html.util.JsoupUtils

public class JsoupUtils extends Object
JSoup工具类
从以下版本开始:
2021-03-03
  • 构造器概要

    构造器
    构造器
    说明
     
  • 方法概要

    修饰符和类型
    方法
    说明
    static org.jsoup.select.Elements
    children(org.jsoup.nodes.Element parent, String tag)
    选取指定标签的子元素
    static org.jsoup.select.Elements
    children(org.jsoup.nodes.Element parent, String... tags)
    选取指定标签的子元素
    static org.jsoup.select.Elements
    childRows(org.jsoup.nodes.Element parent)
    选取表格的所有行元素
    static org.jsoup.nodes.Element
    firstChild(org.jsoup.nodes.Element parent, String tag)
    选取第一个指定标签的子元素
    static org.jsoup.nodes.Document
    parse(String html)
     
    static void
    selectChildren(org.jsoup.select.Elements collection, org.jsoup.nodes.Element parent, Predicate<org.jsoup.nodes.Element> predicate)
    选取符合条件的子元素到目标集合中

    从类继承的方法 java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 构造器详细资料

    • JsoupUtils

      public JsoupUtils()
  • 方法详细资料

    • selectChildren

      public static void selectChildren(org.jsoup.select.Elements collection, org.jsoup.nodes.Element parent, Predicate<org.jsoup.nodes.Element> predicate)
      选取符合条件的子元素到目标集合中
      参数:
      collection - 目标集合
      parent - 父元素
      predicate - 条件
    • children

      public static org.jsoup.select.Elements children(org.jsoup.nodes.Element parent, String tag)
      选取指定标签的子元素
      参数:
      parent - 父元素
      tag - 标签名称,小写
      返回:
      子元素集合
    • children

      public static org.jsoup.select.Elements children(org.jsoup.nodes.Element parent, String... tags)
      选取指定标签的子元素
      参数:
      parent - 父元素
      tags - 多种标签名称,小写
      返回:
      子元素集合
    • firstChild

      public static org.jsoup.nodes.Element firstChild(org.jsoup.nodes.Element parent, String tag)
      选取第一个指定标签的子元素
      参数:
      parent - 父元素
      tag - 标签名称,小写
      返回:
      子元素
    • childRows

      public static org.jsoup.select.Elements childRows(org.jsoup.nodes.Element parent)
      选取表格的所有行元素
      参数:
      parent - 表格元素
      返回:
      行元素集合
    • parse

      public static org.jsoup.nodes.Document parse(String html)
      另请参阅:
      • Jsoup.parseBodyFragment(String)
      • Parser.parseBodyFragment(String, String)