Let us discuss how to parse HTML from file using Jsoup API with the help of below example.
Follow the below steps:
1. Create file object using HTML file.
2. Use parse(File in, String charsetName) method of Jsoup class which returns Document object after processing the file object.
3. Use title() method of Document class to get the title.
4. Print the title.
2. Use parse(File in, String charsetName) method of Jsoup class which returns Document object after processing the file object.
3. Use title() method of Document class to get the title.
4. Print the title.
Example:
JsoupParseHTMLFromFile.java
No comments:
Post a Comment