From: Ahmed A. <asa...@ya...> - 2015-08-24 01:53:01
|
Hi, VBScript is not supported by HtmlUnit, only JavaScript. Ahmed From: "Marks, David" <Dav...@nr...> To: "htm...@li..." <htm...@li...> Sent: Thursday, August 20, 2015 10:30 PM Subject: [Htmlunit-user] Error Accessing Page Hello, I'm a new user to HtmlUnit and am unfortunately receiving an error on the first page I tried to load. I'm not sure if the error lies with me or the page, but here are the details: Code I am trying to execute public void homePage() throws Exception { try (final WebClient webClient = new WebClient()) { final HtmlPage page = webClient.getPage("http://www.ukho.gov.uk/ProductsandServices/MartimeSafety/Pages/NMPublic.aspx"); } catch(Exception e) { e.printStackTrace(); } } It's failing on the getPage call, saying "======= EXCEPTION START ======== Exception class=[net.sourceforge.htmlunit.corejs.javascript.EvaluatorException] com.gargoylesoftware.htmlunit.ScriptException: syntax error (script in http://www.ukho.gov.uk/ProductsandServices/MartimeSafety/Pages/NMPublic.aspx from (714, 460) to (755, 10)#744)" followed by an impressively long stack trace. Lines 714-755 of the page seem to be snippets of code dealing with the browser context and the start of a VBSCRIPT block. Does this page have elements HtmlUnit can't handle currently or is my accessing approach incorrect? Thanks for the help, David Marks |