Java HTML Parse Jsoup parse(final String html)

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

Description

Parses the specified html code.

License

Open Source License

Parameter

Parameter Description
html The HTML code to parse.

Return

The parsed document.

Declaration

public static Document parse(final String html) 

Method Source Code


//package com.java2s;
/*//from   ww  w  .j  av a2  s . com
 * Copyright (C) 2012 Klaus Reimer <k@ailis.de>
 * See LICENSE.md for licensing information.
 */

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

public class Main {
    /**
     * Parses the specified html code.
     * 
     * @param html
     *            The HTML code to parse.
     * @return The parsed document.
     */
    public static Document parse(final String html) {
        Document doc = Jsoup.parseBodyFragment(html);
        doc.outputSettings().prettyPrint(false);
        return doc;
    }
}

Related

  1. getPlainText(String htmlText)
  2. getPlainTextFromHtml(String html)
  3. getTitle(String htmlContent)
  4. htmlArray2textArray(List htmlArray)
  5. isHTMLEmpty(String textToCheck)
  6. parse(InputStream input, String documentIRI, String encoding)
  7. parse(String html)
  8. parse(String html)
  9. parse(String html)