0
這是我的HtmlUnit如何啓用JavaScript的HtmlUnit
final WebClient webClient = new WebClient();
webClient.getOptions().setJavaScriptEnabled(true);
webClient.getOptions().setCssEnabled(false);
webClient.getOptions().setRedirectEnabled(true);
webClient.getOptions().setThrowExceptionOnScriptError(false);
webClient.setThrowExceptionOnFailingStatusCode(false);
webClient.setTimeout(20000);
//webClient.setSSLClientCertificate(certificateUrl,
certificatePassword, certificateType);
HtmlPage page1 = (HtmlPage)webClient.getPage("http://oneurl");
編碼,但我得到像
WARN APOPERATOR "htmlunit.IncorrectnessListenerImpl" Obsolete content type encountered: 'text/javascript'.
ERROR APOPERATOR "javascript.StrictErrorReporter" runtimeError: message=[The data necessary to complete this operation is not yet available.] sourceName=[http://easypay.swisscom.ch/charging-engine-checkout/js/libs/jquery-1.9.1.min.js] line=[3] lineSource=[null] lineOffset=[0]
WARN APOPERATOR "html.HTMLDocument" getElementById(sizzle-1447848465222) did a getElementByName for Internet Explorer
WARN APOPERATOR "htmlunit.IncorrectnessListenerImpl" Obsolete content type encountered: 'text/javascript'.
錯誤任何人都可以請幫助啓用JavaScript的HtmlUnit?