Constructor
new HtmlDocument(source)
Construct a new HTML document.
Parameters:
Name | Type | Description |
---|---|---|
source |
String | The HTML source code. |
- Source:
Returns:
A new HTML document.
Methods
getAll(elementName)
Retrieves all elements by name from the document.
The returned object structure is compatible for usage
in jala.XmlWriter.
Parameters:
Name | Type | Description |
---|---|---|
elementName |
String | The name of the desired element |
- Source:
Returns:
The list of available elements in the document
getLinks()
Get all link elements of the HTML document.
- Source:
Returns:
A list of link elements.
scrape(xpathExpr)
Get all document nodes from an XPath expression.
Parameters:
Name | Type | Description |
---|---|---|
xpathExpr |
String | An XPath expression. |
- Source:
Returns:
A list of HTML elements.
toString()
Get a string representation of the HTML document.
- Source:
Returns:
A string representation of the HTML document.