An error occurred while parsing an HTML string.
You may need to parse a file or HTML string from a user input, retrieve its content, verify its format, or modify it. What should I do? Jsonu helps you easily solve these problems
Solution
Use staticJsoup. parse (String html)
Method orJsoup. parse (String html, String baseUri)
Sample Code:
String html ="First parse"+"Parsed HTML into a doc.
"; Document doc = Jsoup. parse (html );
Description
Parse (String html, String baseUri)
This method parses the entered HTML into a new Document. The baseUri parameter is used to convert the relative URL to an absolute URL and specify the website from which the Document is obtained. If this method is not applicable, you can useParse (String html)
Method to parse the string into an HTML string ..
As long as the parsed string is not null, a reasonably structured document can be returned, containing (at least) a head and a body element.
Once you have a Document, you can use the appropriate method in the Document or its parent class.Element
AndNode
To obtain the relevant data.