Let us discuss how to parse HTML from string using Jsoup API with the help of below example.
Follow the below steps:
1. Define HTML as a string.
2. Use parse(String html) method of Jsoup class which returns Document object after processing the html string.
3. Use title() method of Document class to get the title.
4. Print the title.
2. Use parse(String html) method of Jsoup class which returns Document object after processing the html string.
3. Use title() method of Document class to get the title.
4. Print the title.
Example:
JsoupParseHTMLFromString.java
No comments:
Post a Comment