From: Ahmed A. <asa...@ya...> - 2015-04-21 10:39:40
|
Hi, You page has errors. You should wait 'after' getting the page. Please read: - http://htmlunit.sourceforge.net/faq.html#AJAXDoesNotWork - HtmlUnit – Submitting JavaScript Bugs Ahmed From: Alamgir Farouk <afa...@ho...> To: "htm...@li..." <htm...@li...> Sent: Tuesday, April 21, 2015 12:29 PM Subject: [Htmlunit-user] executing javascript which itself is dynamically loaded <!--#yiv6969796273 .yiv6969796273hmmessage P{margin:0px;padding:0px;}#yiv6969796273 body.yiv6969796273hmmessage{font-size:12pt;font-family:Calibri;}-->our site (test) is http://appointment-service.com/cmt2_lefoodtruck (ignore the names, they have no meaning) In order to optimize loading on a mobile phone, we download the bulk of they javascript and css dynamically, via a small javascript function. I am not sure if this is the problem or something else is wrong, but when I try to load this site using HtmlUnit, it appears that the javascript is not being executed. (java excerpt) final WebClient webClient = new WebClient(BrowserVersion.INTERNET_EXPLORER_11); webClient.waitForBackgroundJavaScript(40000); HtmlPage page = webClient.getPage("http://appointment-service.com/cmt2_lefoodtruck"); System.out.println(page.asXml()); webClient.close(); What are our options? We are trying to create html snapshots for Google indexing. Thanks |