Element Class

Used to represent a DOM element in an HTML document.

Constructors

protected Element( String tagHTML )

Methods

getAttribute( String attributeName ) returns String
Returns the value for a given attribute. If no match is found, returns an empty string.
getElementByAttributes( String tagName, String attributeName, String attributeValue ) returns javaxt.html.Element
Returns the first HTML Element with given tag name and attribute. Returns null if an element was not found.
getElementByID( String id ) returns javaxt.html.Element
Returns an HTML Element with given a id. Returns null if the element was not found.
getElementByTagName( String tagName ) returns javaxt.html.Element
Returns the first HTML Element with given tag name. Returns null if an element was not found.
getElements( String tagName, String attributeName, String attributeValue ) returns javaxt.html.Element[]
Returns an array of HTML Elements with given tag name, attribute, and attribute value (e.g. "div", "class", "panel-header").
getElementsByTagName( String tagName ) returns javaxt.html.Element[]
Returns an array of HTML Elements with given tag name.
getImageLinks( ) returns String[]
Returns a list of links to images. The links may include relative paths. Use the Parser.getAbsolutePath() method to resolve the relative paths to a fully qualified url.
getInnerHTML( ) returns String
Returns the HTML content (inner HTML) of an element as a String.
getInnerText( ) returns String
Removes all HTML tags and attributes inside this element, leaving the raw rendered text.
getName( ) returns String
Returns the element tag/node name.
getOuterHTML( ) returns String
Returns the HTML used to define this element (tag and attributes), as well as the HTML content (inner HTML). You can use this String to remove or replace elements from the original HTML document.
toString( ) returns String
Returns the outer HTML of this element. See getOuterHTML() for more information.