Package org.apache.nutch.protocol.htmlunit

## Class HtmlUnitWebDriver

- java.lang.Object
- - org.openqa.selenium.htmlunit.HtmlUnitDriver
  - - org.apache.nutch.protocol.htmlunit.HtmlUnitWebDriver

- All Implemented Interfaces:
    `org.openqa.selenium.HasCapabilities`, `org.openqa.selenium.interactions.HasInputDevices`, `org.openqa.selenium.internal.FindsByClassName`, `org.openqa.selenium.internal.FindsByCssSelector`, `org.openqa.selenium.internal.FindsById`, `org.openqa.selenium.internal.FindsByLinkText`, `org.openqa.selenium.internal.FindsByName`, `org.openqa.selenium.internal.FindsByTagName`, `org.openqa.selenium.internal.FindsByXPath`, `org.openqa.selenium.JavascriptExecutor`, `org.openqa.selenium.SearchContext`, `org.openqa.selenium.WebDriver`

      public class HtmlUnitWebDriver
      extends org.openqa.selenium.htmlunit.HtmlUnitDriver

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class org.openqa.selenium.htmlunit.HtmlUnitDriver

      `org.openqa.selenium.htmlunit.HtmlUnitDriver.HtmlUnitWindow, org.openqa.selenium.htmlunit.HtmlUnitDriver.JavaScriptResultsCollection`

    - ### Nested classes/interfaces inherited from interface org.openqa.selenium.WebDriver

      `org.openqa.selenium.WebDriver.ImeHandler, org.openqa.selenium.WebDriver.Navigation, org.openqa.selenium.WebDriver.Options, org.openqa.selenium.WebDriver.TargetLocator, org.openqa.selenium.WebDriver.Timeouts, org.openqa.selenium.WebDriver.Window`

  - ### Field Summary

    - ### Fields inherited from class org.openqa.selenium.htmlunit.HtmlUnitDriver

      `BROWSER_LANGUAGE_CAPABILITY, DOWNLOAD_IMAGES_CAPABILITY, INVALIDSELECTIONERROR, INVALIDXPATHERROR, JAVASCRIPT_ENABLED`

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `HtmlUnitWebDriver()` |

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `static void` | `cleanUpDriver​(org.openqa.selenium.WebDriver driver)` |
    `static org.openqa.selenium.WebDriver` | `getDriverForPage​(String url, Configuration conf)` |
    `static String` | `getHTMLContent​(org.openqa.selenium.WebDriver driver, Configuration conf)` |
    `static String` | `getHtmlPage​(String url, Configuration conf)` | Function for obtaining the HTML BODY using the selected selenium webdriver There are a number of configuration properties within `nutch-site.xml` which determine whether to take screenshots of the rendered pages and persist them as timestamped .png's into HDFS.
    `protected com.gargoylesoftware.htmlunit.WebClient` | `modifyWebClient​(com.gargoylesoftware.htmlunit.WebClient client)` |

    - ### Methods inherited from class org.openqa.selenium.htmlunit.HtmlUnitDriver

      `assertElementNotStale, close, executeAsyncScript, executeScript, findElement, findElementByClassName, findElementByCssSelector, findElementById, findElementByLinkText, findElementByName, findElementByPartialLinkText, findElementByTagName, findElementByXPath, findElements, findElementsByClassName, findElementsByCssSelector, findElementsById, findElementsByLinkText, findElementsByName, findElementsByPartialLinkText, findElementsByTagName, findElementsByXPath, get, get, getBrowserVersion, getCapabilities, getCurrentUrl, getCurrentWindow, getElementById, getKeyboard, getMouse, getPageSource, getTitle, getWebClient, getWindowHandle, getWindowHandles, implicitlyWaitFor, isAcceptSslCertificates, isDownloadImages, isJavascriptEnabled, lastPage, manage, navigate, newWebClient, pickWindow, quit, setAcceptSslCertificates, setAutoProxy, setDownloadImages, setExecutor, setHTTPProxy, setJavascriptEnabled, setProxy, setProxySettings, setSocksProxy, setSocksProxy, switchTo, toWebElement`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### HtmlUnitWebDriver

          public HtmlUnitWebDriver()

  - ### Method Detail

    - #### modifyWebClient

          protected com.gargoylesoftware.htmlunit.WebClient modifyWebClient​(com.gargoylesoftware.htmlunit.WebClient client)

      Overrides:
        `modifyWebClient` in class `org.openqa.selenium.htmlunit.HtmlUnitDriver`

    - #### getDriverForPage

          public static org.openqa.selenium.WebDriver getDriverForPage​(String url,
                                                                       Configuration conf)

    - #### getHTMLContent

          public static String getHTMLContent​(org.openqa.selenium.WebDriver driver,
                                              Configuration conf)

    - #### cleanUpDriver

          public static void cleanUpDriver​(org.openqa.selenium.WebDriver driver)

    - #### getHtmlPage

          public static String getHtmlPage​(String url,
                                           Configuration conf)

      Function for obtaining the HTML BODY using the selected selenium webdriver There are a number of configuration properties within `nutch-site.xml` which determine whether to take screenshots of the rendered pages and persist them as timestamped .png's into HDFS.
      Parameters:
        `url` - the URL to fetch and render
        `conf` - the `Configuration`
      Returns:
        the rendered inner HTML page