There is a problem
An HTML string from user input, a file, or a Web site, you may need to parse it and take its contents, or verify that it is in a complete format, or you want to modify it. What to do? Jsonu can help you solve these problems easily
Workaround
use static jsoup.parse (String html)
method or jsoup.parse (string html, String baseUri)
Sample code:
String html = "
Describeparse (string html, String BaseUri)
This method can parse the input HTML into a new document ( Document), the parameter BaseUri is used to convert the relative URL to an absolute URL and specify from which Web site to obtain the documents. If this method does not apply, you can use parse (string html)
method to parse into an HTML string as in the example above:
As long as the parse is not an empty string, you can return a well-structured document that contains (at least) a head and a BODY element.
Once you have a document, you can use the appropriate method in document or its parent class Element
and Node
the methods in it to get the relevant data.
Jsoup Learning Rites parsing an HTML string