public class Parser
extends Object
| Constructor and Description |
|---|
Parser() |
| Modifier and Type | Method and Description |
|---|---|
String |
getBody(Document doc)
Method to get and return the contents of a web pages body.
|
Document |
getDocument(String url)
Get the web page, create a Document object and return it
You should use JSoup to do that and customize all the exceptions by throwing ParseException
|
Elements |
getLinks(Document doc)
Method to extract and enumerate all links on a given web page
|
public Document getDocument(String url)
throws ParseException
url - - webpage to capture as a Document objectParseException - - Simple custom exception with a message.public Elements getLinks(Document doc)
throws ParseException
doc - - Document object to parseParseException - - thrown when document is nullpublic String getBody(Document doc)
throws ParseException
doc - - Document object to parseParseException - - thrown when document is null