Java HTML Parse Jsoup parse(String html)

Here you can find the source of parse(String html)

Description

convert html String to Document (A lot more easier to manage it)

License

Open Source License

Parameter

Parameter Description
html input html

Return

Document (include html body and head Tag)

Declaration

public static Document parse(String html) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;

public class Main {
    private static Document.OutputSettings setting;

    /**//from w  w  w  .ja  v  a2  s  .co  m
     * convert html String to {@link Document} (A lot more easier to manage it)
     *
     * @param html
     *       input html
     * @return Document (include html body and head Tag)
     * @see Document
     * @see Document#head()
     * @see Document#body()
     */
    public static Document parse(String html) {
        Document document = Jsoup.parse(html);
        if (setting != null)
            return document.outputSettings(setting);
        return document;
    }
}

Related

  1. htmlArray2textArray(List htmlArray)
  2. isHTMLEmpty(String textToCheck)
  3. parse(final String html)
  4. parse(InputStream input, String documentIRI, String encoding)
  5. parse(String html)
  6. parse(String html)
  7. parse(URL url, int timeout)
  8. parseByteData(ByteBuffer byteData, String charsetName, String baseUri, Parser parser)
  9. parseEmail(String content)