public interface HTMLParser
Interface for the parser used to parse HTML into a HtmlUnit-specific DOM (HU-DOM) tree.
| Modifier and Type | Method and Description |
|---|---|
ElementFactory |
getElementFactory(SgmlPage page,
String namespaceURI,
String qualifiedName,
boolean insideSvg,
boolean svgSupport)
INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
|
ElementFactory |
getFactory(String tagName)
INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
|
ElementFactory |
getSvgFactory()
INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
|
void |
parse(WebClient webClient,
WebResponse webResponse,
HtmlPage page,
boolean xhtml,
boolean createdByJavascript)
Parses the WebResponse into an object tree representation.
|
default void |
parse(WebResponse webResponse,
HtmlPage page,
boolean xhtml,
boolean createdByJavascript)
Deprecated.
as of version 4.12.0; use
parse(WebClient, WebResponse, HtmlPage, boolean, boolean) instead. |
default void |
parseFragment(DomNode parent,
DomNode context,
String source,
boolean createdByJavascript)
Deprecated.
as of version 4.12.0; use
parseFragment(WebClient, DomNode, DomNode, String, boolean) instead. |
default void |
parseFragment(DomNode parent,
String source)
Deprecated.
as of version 4.12.0; use
parseFragment(WebClient, DomNode, DomNode, String, boolean) instead. |
void |
parseFragment(WebClient webClient,
DomNode parent,
DomNode context,
String source,
boolean createdByJavascript)
Parses the HTML content from the given string into an object tree representation.
|
ElementFactory getFactory(String tagName)
tagName - an HTML element tag nameElementFactory getSvgFactory()
ElementFactory getElementFactory(SgmlPage page, String namespaceURI, String qualifiedName, boolean insideSvg, boolean svgSupport)
page - the pagenamespaceURI - the namespace URIqualifiedName - the qualified nameinsideSvg - is the node inside an SVG node or notsvgSupport - true if called from javascript createElementNS@Deprecated default void parseFragment(DomNode parent, String source) throws SAXException, IOException
parseFragment(WebClient, DomNode, DomNode, String, boolean) instead.parent - the parent for the new nodessource - the (X)HTML to be parsedSAXException - if a SAX error occursIOException - if an IO error occursvoid parseFragment(WebClient webClient, DomNode parent, DomNode context, String source, boolean createdByJavascript) throws SAXException, IOException
webClient - the WebClientparent - where the new parsed nodes will be added tocontext - the context to build the fragment context stacksource - the (X)HTML to be parsedcreatedByJavascript - if true the (script) tag was created by javascriptSAXException - if a SAX error occursIOException - if an IO error occurs@Deprecated default void parseFragment(DomNode parent, DomNode context, String source, boolean createdByJavascript) throws SAXException, IOException
parseFragment(WebClient, DomNode, DomNode, String, boolean) instead.parent - where the new parsed nodes will be added tocontext - the context to build the fragment context stacksource - the (X)HTML to be parsedcreatedByJavascript - if true the (script) tag was created by javascriptSAXException - if a SAX error occursIOException - if an IO error occursvoid parse(WebClient webClient, WebResponse webResponse, HtmlPage page, boolean xhtml, boolean createdByJavascript) throws IOException
webClient - the WebClientwebResponse - the response datapage - the HtmlPage to add the nodesxhtml - if true use the XHtml parsercreatedByJavascript - if true the (script) tag was created by javascriptIOException - if there is an IO error@Deprecated default void parse(WebResponse webResponse, HtmlPage page, boolean xhtml, boolean createdByJavascript) throws IOException
parse(WebClient, WebResponse, HtmlPage, boolean, boolean) instead.webResponse - the response datapage - the HtmlPage to add the nodesxhtml - if true use the XHtml parsercreatedByJavascript - if true the (script) tag was created by javascriptIOException - if there is an IO errorCopyright © 2002–2025 Gargoyle Software Inc.. All rights reserved.