public class

Parser

extends Object
java.lang.Object
   ↳ org.jsoup.parser.Parser

Class Overview

Parses HTML into a Document. Generally best to use one of the more convenient parse methods in Jsoup.

Summary

Public Methods
static Document parse(String html, String baseUri)
Parse HTML into a Document.
static Document parseBodyFragment(String bodyHtml, String baseUri)
Parse a fragment of HTML into the body of a Document.
static Document parseBodyFragmentRelaxed(String bodyHtml, String baseUri)
Parse a fragment of HTML into the body of a Document, with relaxed parsing enabled.
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public static Document parse (String html, String baseUri)

Parse HTML into a Document.

Parameters
html HTML to parse
baseUri base URI of document (i.e. original fetch location), for resolving relative URLs.
Returns
  • parsed Document

public static Document parseBodyFragment (String bodyHtml, String baseUri)

Parse a fragment of HTML into the body of a Document.

Parameters
bodyHtml fragment of HTML
baseUri base URI of document (i.e. original fetch location), for resolving relative URLs.
Returns
  • Document, with empty head, and HTML parsed into body

public static Document parseBodyFragmentRelaxed (String bodyHtml, String baseUri)

Parse a fragment of HTML into the body of a Document, with relaxed parsing enabled. Relaxed, in this context, means that implicit tags are not automatically created when missing.

Parameters
bodyHtml fragment of HTML
baseUri base URI of document (i.e. original fetch location), for resolving relative URLs.
Returns
  • Document, with empty head, and HTML parsed into body