Package com.meterware.httpunit
Class HTMLPage
- java.lang.Object
-
- com.meterware.httpunit.ParsedHTML
-
- com.meterware.httpunit.HTMLPage
-
public class HTMLPage extends ParsedHTML
This class represents an HTML page returned from a request.- Author:
- Russell Gold, Benoit Xhenseval
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classHTMLPage.Scriptablescriptable for HTML Page
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetExternalStyleSheet()Returns the location of the linked stylesheet in the headjava.lang.String[]getMetaTagContent(java.lang.String attribute, java.lang.String attributeValue)Retrieves the "content" of the meta tags for a key pair attribute-attributeValue.java.lang.StringgetOnLoadEvent()Returns the onLoad event script.java.lang.StringgetTitle()Returns the title of the page.voidparse(java.lang.String text, java.net.URL pageURL)parse the given test with the given URL-
Methods inherited from class com.meterware.httpunit.ParsedHTML
getApplets, getDOM, getElementNames, getElementsWithAttribute, getElementsWithName, getElementWithID, getFirstMatchingForm, getFirstMatchingLink, getFirstMatchingTable, getFirstMatchingTextBlock, getForms, getFormWithID, getFormWithName, getFrames, getImages, getImageWithAltText, getImageWithName, getImageWithSource, getLinks, getLinkWith, getLinkWithID, getLinkWithImageText, getLinkWithName, getMatchingForms, getMatchingLinks, getMatchingTables, getNextTextBlock, getTables, getTableStartingWith, getTableStartingWithPrefix, getTableWithID, getTableWithSummary, getTextBlocks, isWebLink, toString
-
-
-
-
Method Detail
-
getTitle
public java.lang.String getTitle() throws org.xml.sax.SAXExceptionReturns the title of the page.- Throws:
org.xml.sax.SAXException
-
getOnLoadEvent
public java.lang.String getOnLoadEvent() throws org.xml.sax.SAXExceptionReturns the onLoad event script.- Throws:
org.xml.sax.SAXException
-
getExternalStyleSheet
public java.lang.String getExternalStyleSheet() throws org.xml.sax.SAXExceptionReturns the location of the linked stylesheet in the head- Throws:
org.xml.sax.SAXException
-
getMetaTagContent
public java.lang.String[] getMetaTagContent(java.lang.String attribute, java.lang.String attributeValue)Retrieves the "content" of the meta tags for a key pair attribute-attributeValue.this can be used like thisgetMetaTagContent("name","robots") will return { "index","follow" } getMetaTagContent("http-equiv","Expires") will return { "now" }
-
parse
public void parse(java.lang.String text, java.net.URL pageURL) throws org.xml.sax.SAXException, java.io.IOExceptionparse the given test with the given URL- Parameters:
text-pageURL-- Throws:
org.xml.sax.SAXExceptionjava.io.IOException
-
-