Let us discuss how to parse HTML from URL using Jsoup API with the help of below example.
Follow the below steps:
1. Use connect(String url) method of Jsoup class which returns the connection of specified URL.
2. Use get() method of Connection class which returns Document object.
3. Use title() method of Document class to get the title.
4. Print the title.
2. Use get() method of Connection class which returns Document object.
3. Use title() method of Document class to get the title.
4. Print the title.
Example:
JsoupParseHTMLFromURL.java
No comments:
Post a Comment