org.jsoup.parser.Parser.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(1.4k)|赞(0)|评价(0)|浏览(144)

本文整理了Java中org.jsoup.parser.Parser.<init>()方法的一些代码示例,展示了Parser.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Parser.<init>()方法的具体详情如下:
包路径:org.jsoup.parser.Parser
类名称:Parser
方法名:<init>

Parser.<init>介绍

[英]Create a new Parser, using the specified TreeBuilder
[中]使用指定的TreeBuilder创建新的解析器

代码示例

代码示例来源:origin: org.jsoup/jsoup

/**
 * Create a new HTML parser. This parser treats input as HTML5, and enforces the creation of a normalised document,
 * based on a knowledge of the semantics of the incoming tags.
 * @return a new HTML parser.
 */
public static Parser htmlParser() {
  return new Parser(new HtmlTreeBuilder());
}

代码示例来源:origin: org.jsoup/jsoup

/**
   * Create a new XML parser. This parser assumes no knowledge of the incoming tags and does not treat it as HTML,
   * rather creates a simple tree directly from the input.
   * @return a new simple XML parser.
   */
  public static Parser xmlParser() {
    return new Parser(new XmlTreeBuilder());
  }
}

代码示例来源:origin: astamuse/asta4d

protected Document parse(InputStream input) throws IOException {
  return Jsoup.parse(input, "UTF-8", "", new Parser(new Asta4DTagSupportHtmlTreeBuilder()));
}

代码示例来源:origin: tangqi92/BuildingBlocks

LinkedHashMap<String, String> extra = new LinkedHashMap<String, String>();
LinkedHashMap<String, String> article = new LinkedHashMap<String, String>();
Document document = Jsoup.parse(xml, "", new Parser(new XmlTreeBuilder()));
Elements all = document.getAllElements();
for (Element content : all) {

相关文章