java.lang.ClassCastException: com.gargoylesoftware.htmlunit.javascript.host.Window cannot be cast to com.gargoylesoftware.htmlunit.javascript.host.html.HTMLDocument

htmlunit | derrichter | 11 months ago
tip
Do you know that we can give you better hits? Get more relevant results from Samebug’s stack trace search.
  1. 0

    getAnchorByText brings ClassCastException

    htmlunit | 11 months ago | derrichter
    java.lang.ClassCastException: com.gargoylesoftware.htmlunit.javascript.host.Window cannot be cast to com.gargoylesoftware.htmlunit.javascript.host.html.HTMLDocument

    Root Cause Analysis

    1. java.lang.ClassCastException

      com.gargoylesoftware.htmlunit.javascript.host.Window cannot be cast to com.gargoylesoftware.htmlunit.javascript.host.html.HTMLDocument

      at com.gargoylesoftware.htmlunit.javascript.host.Window.getComputedStyle()
    2. HtmlUnit
      HtmlPage.getAnchorByText
      1. com.gargoylesoftware.htmlunit.javascript.host.Window.getComputedStyle(Window.java:1587)
      2. com.gargoylesoftware.htmlunit.html.HtmlSerializer.appendNode(HtmlSerializer.java:276)
      3. com.gargoylesoftware.htmlunit.html.HtmlSerializer.asText(HtmlSerializer.java:62)
      4. com.gargoylesoftware.htmlunit.html.DomNode.asText(DomNode.java:794)
      5. com.gargoylesoftware.htmlunit.html.HtmlPage.getAnchorByText(HtmlPage.java:628)
      5 frames