Hi,
I was using htmlunit to access the site "http://www.imdb.com". I got
an exception trace which looked like this :
EcmaError: lineNumber=[5] column=[0] lineSource=[
ishp=(document.body.isHomePage(us) ||
document.body.isHomePage(us+'/'));] name=[TypeError]
sourceName=[Embedded script] message=[undefined is not a function.]
errorObject=[TypeError: undefined is not a function.]
com.gargoylesoftware.htmlunit.ScriptException: undefined is not a function.
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.execute(JavaScriptEngine.java:264)
at com.gargoylesoftware.htmlunit.html.HtmlPage.executeJavaScriptIfPossible(HtmlPage.java:702)
at com.gargoylesoftware.htmlunit.ScriptFilter.executeScript(ScriptFilter.java:274)
at com.gargoylesoftware.htmlunit.ScriptFilter.endElement(ScriptFilter.java:233)
at org.cyberneko.html.HTMLTagBalancer.callEndElement(Unknown Source)
at org.cyberneko.html.HTMLTagBalancer.endElement(Unknown Source)
at org.cyberneko.html.HTMLScanner$SpecialScanner.scan(Unknown Source)
at org.cyberneko.html.HTMLScanner.scanDocument(Unknown Source)
at org.cyberneko.html.HTMLConfiguration.parse(Unknown Source)
at org.cyberneko.html.HTMLConfiguration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.parse(HTMLParser.java:279)
at com.gargoylesoftware.htmlunit.html.HTMLParser.parse(HTMLParser.java:217)
at com.gargoylesoftware.htmlunit.DefaultPageCreator.createHtmlPage(DefaultPageCreator.java:110)
at com.gargoylesoftware.htmlunit.DefaultPageCreator.createPage(DefaultPageCreator.java:82)
at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseInto(WebClient.java:569)
at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:536)
at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:454)
at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:326)
at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:270)
at com.trilogy.quickstart.htmlunit.test.TestIMDB.testSubscription(TestIMDB.java:38)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
It is due to the use of document.body ? I noticed there's a bug
relating to document.body fixed in the existing version of htmlunit. I
should also mention that in the case of imd.com, the use of
document.body is within <body></body>
Regards
Vinay
|