有没有android的版本版的htmlunit

I have downloaded htmlunit 2.11 zip. i have extract it. then i have tried to paste them in my project's libs folder. from the libs folder i have added them in build path. then i get this error, while i was trying to run my app
conversion to dalvik format failed with error 1
then, from stackoverflow i found that, one said to delete xalan xercesImpl xml-apis.
i deleted them. but getting this error:
Error generating final archive: Found duplicate file for APK: about.html
error message also showed that which files are conflicted. they are jetty-http jetty-io jetty-util jetty-websocket then i run my app again. this time it shows some warning. i have ignored them. but my app crash saying that classNotFound
by the way, i have also deleted httpclient jar. because one said that httpclient is already built in android.
this is my problem. Now, can anyone help me? i really want to use htmlunit in my app
it will be very helpfull if you show me the steps, 'how to add htmlunit in my project'
mainly i have a link, which i have get after login (i have login through web view) this link give me a simple page. in that page there is a textarea and a submit button. and there are some javascript too (i think these javascript run, when i press the submit button). i can do it through webview, but for some reason i don't want to use webview. whene i press submit button, it deliver the value of textarea and some value of hidden field with existing cookies(which are get when i logged in through webview) Post method. i need to do this without webview. now is there any other option beside htmlunit ?? i heard about HttpClient, HttpUrlConnection. one more thing, agter submitting it will redirect me to another page. i don't need to do anything with this redirected page.
N.B: if this question is not appropriate with what i really ask previously, then you can suggest me, and i will post a new question. thank you
解决方案 sorry, i have lost all my hope on HTMLUNIT. :( to gain my goal i have used HttpUrlConnection & Jsoup ... that works for me.
i have post my code in answer.
本文地址: &
我已经下载了2.11的HtmlUnit拉链。我有解压。然后我试图将其粘贴在我的项目的libs文件夹中。从libs文件夹我已经在构建路径中添加他们。然后我得到这个错误,当我试图运行我的应用程序
转换成Dalvik的格式失败,出现错误1
那么,从计算器我发现,一说要删除的Xalan
xercesImpl
XML -apis 。
我删除它们。但得到这个错误:
错误产生最终的归档文件:找到重复的文件APK:about.html
错误信息还显示,该文件是冲突的。他们是码头-HTTP
码头-的WebSocket 然后我重新运行我的应用程序。这一次,它显示了一些警告。我已经忽略了他们。但我的应用程序崩溃说, ClassNotFound的
顺便说一句,我也删除的HttpClient 罐子。因为一个说的HttpClient 已经内置在Android中。
这是我的问题。现在,任何人都可以帮我吗?我真的希望可以使用HtmlUnit,我的应用程序
如果你告诉我的步骤,这将是非常有益的,“如何添加在的HtmlUnit我的项目”
主要是我有一个链接,我已经登录后得到(我已经通过网络查看登录)此链接给我一个简单的页面。在该页面有一个文本区域和一个提交按钮。并有一些JavaScript太(我想这些JavaScript的运行,当我preSS提交按钮)。我可以通过web视图做到这一点,但由于某些原因,我不希望使用web视图。 whene我preSS提交按钮,它提供textarea的价值和隐藏字段与现有的cookie(这是得到,当我登录过的WebView)Post方法有一定价值。我需要做的这一点没有web视图。现在身边有任何的HtmlUnit其他选择?我听说过的HttpClient,HttpURLConnection的。还有一件事,agter提交将我重定向到另一个页面。我不需要用这个重定向的页面进行任何操作。
注:,如果这个问题不适合与什么我真的问previously,那么你可以建议我,我将发布一个新的问题。谢谢
解决方案 对不起,我已经失去了所有的希望寄托在的HtmlUnit。 :(以获得我的目标我已经使用的HttpURLConnection和放大器; Jsoup ...这对我的作品here是我的程序我有我的后code的答案。
本文地址: &
扫一扫关注官方微信java - Using htmlunit try to login in a website, facing this kind error - Stack Overflow
Join Stack Overflow to learn, share knowledge, and build your career.
or sign in with
* To change this template, choose Tools | Templates
* and open the template in the editor.
import java.net.*;
import com.gargoylesoftware.htmlunit.FailingHttpStatusCodeE
import com.gargoylesoftware.htmlunit.WebC
import com.gargoylesoftware.htmlunit.html.*;
import java.io.IOE
import java.util.logging.L
import java.util.logging.L
* @author wangyi
public class Main {
* @param args the command line arguments
public static void main(String[] args) {
Main main = new Main();
main.submittingForm();
} catch (Exception ex) {
Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
public void submittingForm() throws Exception {
final WebClient webClient = new WebClient();
//webClient.setJavaScriptEnabled(false);
// Get the first page
final HtmlPage page1 = webClient.getPage("http://qzone.qq.com/");
// Get the form that we are dealing with and within that form,
// find the submit button and the field that we want to change.
final HtmlForm form = page1.getFormByName("loginform");
//final HtmlSubmitInput button = form.getInputByName("subbtn");
final HtmlSubmitInput button = page1.getHtmlElementById("subbtn");
final HtmlTextInput loginName = form.getInputByName("u");
final HtmlPasswordInput loginPs = form.getInputByName("p");
// Change the value of the text field
loginName.setValueAttribute("");
loginPs.setValueAttribute("5230911,..");
// Now submit the form by clicking the button and get back the second page.
final HtmlPage page2 = button.click();
final String pageAsXml = page2.asText();
System.out.println(pageAsXml);
//webClient.closeAllWindows();
public void homePage() throws Exception {
final WebClient webClient = new WebClient();
final HtmlPage page = webClient.getPage("http://htmlunit.sourceforge.net");
//massertEquals("HtmlUnit - Welcome to HtmlUnit", page.getTitleText());
final String pageAsXml = page.asXml();
//assertTrue(pageAsXml.contains("&body class=\"composite\"&"));
final String pageAsText = page.asText();
//assertTrue(pageAsText.contains("Support for the HTTP and HTTPS protocols"));
//System.out.println(pageAsText);
webClient.closeAllWindows();
Dec 23, :31 PM com.gargoylesoftware.htmlunit.IncorrectnessListenerImpl notify
WARNING: Expected content type of 'application/javascript' or 'application/ecmascript' for remotely loaded JavaScript element at 'http://imgcache.qq.com/ptlogin/ac/v7/js/login_div.js?v=1.2.1', but got 'application/x-javascript'.
Dec 23, :31 PM com.gargoylesoftware.htmlunit.javascript.host.ActiveXObject jsConstructor
WARNING: Automation server can't create object for SSOAxCtrlForPTLogin.SSOForPTLogin2
Dec 23, :31 PM com.gargoylesoftware.htmlunit.javascript.StrictErrorReporter runtimeError
SEVERE: runtimeError: message=[Automation server can't create object] sourceName=[http://imgcache.qq.com/ptlogin/ac/v7/js/login_div.js?v=1.2.1] line=[1] lineSource=[null] lineOffset=[0]
Dec 23, :31 PM com.gargoylesoftware.htmlunit.html.HtmlScript isExecutionNeeded
WARNING: Script is not JavaScript (type: text/html, language: ). Skipping execution.
Dec 23, :31 PM com.gargoylesoftware.htmlunit.html.HtmlScript isExecutionNeeded
WARNING: Script is not JavaScript (type: text/html, language: ). Skipping execution.
Dec 23, :32 PM com.gargoylesoftware.htmlunit.IncorrectnessListenerImpl notify
WARNING: Expected content type of 'application/javascript' or 'application/ecmascript' for remotely loaded JavaScript element at 'http://ptlogin2.qq.com/check?uin=&appid=&r=0.785135', but got 'application/x-javascript'.
Dec 23, :33 PM com.gargoylesoftware.htmlunit.IncorrectnessListenerImpl notify
WARNING: Expected content type of 'application/javascript' or 'application/ecmascript' for remotely loaded JavaScript element at 'http://ptlogin2.qq.com/login?u=&p=3DEA711A779CD7F24D771D1E568D5A94&verifycode=!NU7&=on&aid==http%3A%2F%2Fimgcache.qq.com%2Fqzone%2Fv5%2Floginsucc.html%3Fpara%3Dizone&ptredirect=1&h=1&from_ui=1&dumy=&fp=loginerroralert', but got 'application/x-javascript'.
Dec 23, :33 PM com.gargoylesoftware.htmlunit.IncorrectnessListenerImpl notify
WARNING: Expected content type of 'application/javascript' or 'application/ecmascript' for remotely loaded JavaScript element at 'http://imgcache.qq.com/ac/qzfl/appclientlib.js', but got 'application/x-javascript'.
Dec 23, :35 PM com.gargoylesoftware.htmlunit.IncorrectnessListenerImpl notify
WARNING: Expected content type of 'application/javascript' or 'application/ecmascript' for remotely loaded JavaScript element at 'http://cnc.qzs.qq.com/ac/qzone/qzfl/qzfl_2.0.9.0.js', but got 'application/x-javascript'.
Dec 23, :37 PM com.gargoylesoftware.htmlunit.javascript.host.html.HTMLDocument jsxFunction_getElementById
WARNING: getElementById(script1) did a getElementByName for Internet Explorer
Dec 23, :37 PM com.gargoylesoftware.htmlunit.IncorrectnessListenerImpl notify
WARNING: Expected content type of 'application/javascript' or 'application/ecmascript' for remotely loaded JavaScript element at 'http://cnc.qzonestyle.gtimg.cn/ac/qzone/v5/G/common/global/global_B419b419_b.js', but got 'application/x-javascript'.
Dec 23, :38 PM com.gargoylesoftware.htmlunit.IncorrectnessListenerImpl notify
WARNING: Expected content type of 'application/javascript' or 'application/ecmascript' for remotely loaded JavaScript element at 'http://cnc.qzonestyle.gtimg.cn/ac/qzone/v5/G/common/interface/interface_B419b419_b.js', but got 'application/x-javascript'.
Dec 23, :38 PM com.gargoylesoftware.htmlunit.IncorrectnessListenerImpl notify
WARNING: Expected content type of 'application/javascript' or 'application/ecmascript' for remotely loaded JavaScript element at 'http://cnc.qzonestyle.gtimg.cn/ac/qzone/v5/G/common/shop/shop_B206b207.js', but got 'application/x-javascript'.
Dec 23, :39 PM com.gargoylesoftware.htmlunit.IncorrectnessListenerImpl notify
WARNING: Expected content type of 'application/javascript' or 'application/ecmascript' for remotely loaded JavaScript element at 'http://cnc.qzonestyle.gtimg.cn/ac/qzone/v5/ofp/ofp_B206b207.js', but got 'application/x-javascript'.
Dec 23, :39 PM com.gargoylesoftware.htmlunit.IncorrectnessListenerImpl notify
WARNING: Expected content type of 'application/javascript' or 'application/ecmascript' for remotely loaded JavaScript element at 'http://cnc.qzonestyle.gtimg.cn/qzone/v5/statistic.js', but got 'application/x-javascript'.
Dec 23, :40 PM com.gargoylesoftware.htmlunit.javascript.host.html.HTMLDocument jsxFunction_getElementById
WARNING: getElementById(script8) did a getElementByName for Internet Explorer
Dec 23, :40 PM com.gargoylesoftware.htmlunit.IncorrectnessListenerImpl notify
WARNING: Expected content type of 'application/javascript' or 'application/ecmascript' for remotely loaded JavaScript element at 'http://cnc.qzs.qq.com/ac/qzfl/appclientlib.js', but got 'application/x-javascript'.
Dec 23, :40 PM com.gargoylesoftware.htmlunit.IncorrectnessListenerImpl notify
WARNING: Expected content type of 'application/javascript' or 'application/ecmascript' for remotely loaded JavaScript element at 'http://cnc.qzonestyle.gtimg.cn/qzone/v5/owner2/ic/IC_Core_v2.0.js', but got 'application/x-javascript'.
Dec 23, :41 PM com.gargoylesoftware.htmlunit.IncorrectnessListenerImpl notify
WARNING: Expected content type of 'application/javascript' or 'application/ecmascript' for remotely loaded JavaScript element at 'http://cnc.qzonestyle.gtimg.cn/qzone/v5/owner2/ic/IC_Extend_v2.0.js', but got 'application/x-javascript'.
Dec 23, :41 PM com.gargoylesoftware.htmlunit.IncorrectnessListenerImpl notify
WARNING: Expected content type of 'application/javascript' or 'application/ecmascript' for remotely loaded JavaScript element at 'http://cnc.qzonestyle.gtimg.cn/qzone/v5/owner2/ic/ic_trigger_ex.js', but got 'application/x-javascript'.
Dec 23, :42 PM qzone.Main main
SEVERE: null
net.sourceforge.htmlunit.corejs.javascript.WrappedException: Wrapped com.gargoylesoftware.htmlunit.ScriptException: Wrapped com.gargoylesoftware.htmlunit.ScriptException: TypeError: Cannot find function createElement in object [object]. (http://cnc.qzs.qq.com/ac/qzone/qzfl/qzfl_2.0.9.0.js#331)
at net.sourceforge.htmlunit.corejs.javascript.Context.throwAsScriptRuntimeEx(Context.java:1797)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.doProcessPostponedActions(JavaScriptEngine.java:649)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.processPostponedActions(JavaScriptEngine.java:705)
at com.gargoylesoftware.htmlunit.html.HtmlElement.click(HtmlElement.java:1265)
at com.gargoylesoftware.htmlunit.html.HtmlElement.click(HtmlElement.java:1214)
at com.gargoylesoftware.htmlunit.html.HtmlElement.click(HtmlElement.java:1177)
at qzone.Main.submittingForm(Main.java:54)
at qzone.Main.main(Main.java:27)
Caused by: com.gargoylesoftware.htmlunit.ScriptException: Wrapped com.gargoylesoftware.htmlunit.ScriptException: TypeError: Cannot find function createElement in object [object]. (http://cnc.qzs.qq.com/ac/qzone/qzfl/qzfl_2.0.9.0.js#331)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:601)
at net.sourceforge.htmlunit.corejs.javascript.Context.call(Context.java:537)
at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.call(ContextFactory.java:538)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.execute(JavaScriptEngine.java:499)
at com.gargoylesoftware.htmlunit.html.HtmlPage.loadExternalJavaScriptFile(HtmlPage.java:970)
at com.gargoylesoftware.htmlunit.html.HtmlScript.executeScriptIfNeeded(HtmlScript.java:363)
at com.gargoylesoftware.htmlunit.html.HtmlScript$1.execute(HtmlScript.java:225)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.doProcessPostponedActions(JavaScriptEngine.java:644)
... 6 more
Caused by: com.gargoylesoftware.htmlunit.ScriptException: Wrapped com.gargoylesoftware.htmlunit.ScriptException: TypeError: Cannot find function createElement in object [object]. (http://cnc.qzs.qq.com/ac/qzone/qzfl/qzfl_2.0.9.0.js#331)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:601)
at net.sourceforge.htmlunit.corejs.javascript.Context.call(Context.java:537)
at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.call(ContextFactory.java:538)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.execute(JavaScriptEngine.java:499)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.execute(JavaScriptEngine.java:474)
at com.gargoylesoftware.htmlunit.html.HtmlPage.executeJavaScriptIfPossible(HtmlPage.java:880)
at com.gargoylesoftware.htmlunit.html.HtmlScript.executeInlineScriptIfNeeded(HtmlScript.java:312)
at com.gargoylesoftware.htmlunit.html.HtmlScript.executeScriptIfNeeded(HtmlScript.java:379)
at com.gargoylesoftware.htmlunit.html.HtmlScript$1.execute(HtmlScript.java:225)
at com.gargoylesoftware.htmlunit.html.HtmlScript.onAllChildrenAddedToPage(HtmlScript.java:245)
at com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.endElement(HTMLParser.java:578)
at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
at com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.endElement(HTMLParser.java:536)
at org.cyberneko.html.HTMLTagBalancer.callEndElement(HTMLTagBalancer.java:1136)
at org.cyberneko.html.HTMLTagBalancer.endElement(HTMLTagBalancer.java:1038)
at org.cyberneko.html.filters.DefaultFilter.endElement(DefaultFilter.java:206)
at org.cyberneko.html.filters.NamespaceBinder.endElement(NamespaceBinder.java:329)
at org.cyberneko.html.HTMLScanner$ContentScanner.scanEndElement(HTMLScanner.java:2999)
at org.cyberneko.html.HTMLScanner$ContentScanner.scan(HTMLScanner.java:1991)
at org.cyberneko.html.HTMLScanner.scanDocument(HTMLScanner.java:895)
at org.cyberneko.html.HTMLConfiguration.parse(HTMLConfiguration.java:499)
at org.cyberneko.html.HTMLConfiguration.parse(HTMLConfiguration.java:452)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.parse(HTMLParser.java:765)
at com.gargoylesoftware.htmlunit.html.HTMLParser.parse(HTMLParser.java:211)
at com.gargoylesoftware.htmlunit.html.HTMLParser.parseHtml(HTMLParser.java:165)
at com.gargoylesoftware.htmlunit.DefaultPageCreator.createHtmlPage(DefaultPageCreator.java:225)
at com.gargoylesoftware.htmlunit.DefaultPageCreator.createPage(DefaultPageCreator.java:108)
at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseInto(WebClient.java:429)
at com.gargoylesoftware.htmlunit.WebClient.loadDownloadedResponses(WebClient.java:2127)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.doProcessPostponedActions(JavaScriptEngine.java:627)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.access$400(JavaScriptEngine.java:78)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:596)
... 13 more
Caused by: com.gargoylesoftware.htmlunit.ScriptException: Wrapped com.gargoylesoftware.htmlunit.ScriptException: TypeError: Cannot find function createElement in object [object]. (http://cnc.qzs.qq.com/ac/qzone/qzfl/qzfl_2.0.9.0.js#331)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:601)
at net.sourceforge.htmlunit.corejs.javascript.Context.call(Context.java:537)
at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.call(ContextFactory.java:538)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.execute(JavaScriptEngine.java:499)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.execute(JavaScriptEngine.java:474)
at com.gargoylesoftware.htmlunit.html.HtmlPage.executeJavaScriptIfPossible(HtmlPage.java:880)
at com.gargoylesoftware.htmlunit.html.HtmlScript.executeInlineScriptIfNeeded(HtmlScript.java:312)
at com.gargoylesoftware.htmlunit.html.HtmlScript.executeScriptIfNeeded(HtmlScript.java:379)
at com.gargoylesoftware.htmlunit.html.HtmlScript$1.execute(HtmlScript.java:225)
at com.gargoylesoftware.htmlunit.html.HtmlScript.onAllChildrenAddedToPage(HtmlScript.java:245)
at com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.endElement(HTMLParser.java:578)
at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
at com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.endElement(HTMLParser.java:536)
at org.cyberneko.html.HTMLTagBalancer.callEndElement(HTMLTagBalancer.java:1136)
at org.cyberneko.html.HTMLTagBalancer.endElement(HTMLTagBalancer.java:1038)
at org.cyberneko.html.filters.DefaultFilter.endElement(DefaultFilter.java:206)
at org.cyberneko.html.filters.NamespaceBinder.endElement(NamespaceBinder.java:329)
at org.cyberneko.html.HTMLScanner$ContentScanner.scanEndElement(HTMLScanner.java:2999)
at org.cyberneko.html.HTMLScanner$ContentScanner.scan(HTMLScanner.java:1991)
at org.cyberneko.html.HTMLScanner.scanDocument(HTMLScanner.java:895)
at org.cyberneko.html.HTMLConfiguration.parse(HTMLConfiguration.java:499)
at org.cyberneko.html.HTMLConfiguration.parse(HTMLConfiguration.java:452)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.parse(HTMLParser.java:765)
at com.gargoylesoftware.htmlunit.html.HTMLParser.parse(HTMLParser.java:211)
at com.gargoylesoftware.htmlunit.html.HTMLParser.parseHtml(HTMLParser.java:165)
at com.gargoylesoftware.htmlunit.DefaultPageCreator.createHtmlPage(DefaultPageCreator.java:225)
at com.gargoylesoftware.htmlunit.DefaultPageCreator.createPage(DefaultPageCreator.java:108)
at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseInto(WebClient.java:429)
at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:307)
at com.gargoylesoftware.htmlunit.html.BaseFrame.loadInnerPageIfPossible(BaseFrame.java:141)
at com.gargoylesoftware.htmlunit.html.BaseFrame.loadInnerPage(BaseFrame.java:100)
at com.gargoylesoftware.htmlunit.html.HtmlPage.loadFrames(HtmlPage.java:1763)
at com.gargoylesoftware.htmlunit.html.HtmlPage.initialize(HtmlPage.java:204)
at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseInto(WebClient.java:436)
at com.gargoylesoftware.htmlunit.WebClient.loadDownloadedResponses(WebClient.java:2127)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.doProcessPostponedActions(JavaScriptEngine.java:627)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.access$400(JavaScriptEngine.java:78)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:596)
... 45 more
Caused by: net.sourceforge.htmlunit.corejs.javascript.WrappedException: Wrapped com.gargoylesoftware.htmlunit.ScriptException: TypeError: Cannot find function createElement in object [object]. (http://cnc.qzs.qq.com/ac/qzone/qzfl/qzfl_2.0.9.0.js#331)
at net.sourceforge.htmlunit.corejs.javascript.Context.throwAsScriptRuntimeEx(Context.java:1797)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.doProcessPostponedActions(JavaScriptEngine.java:649)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.access$400(JavaScriptEngine.java:78)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:596)
... 83 more
Caused by: com.gargoylesoftware.htmlunit.ScriptException: TypeError: Cannot find function createElement in object [object]. (http://cnc.qzs.qq.com/ac/qzone/qzfl/qzfl_2.0.9.0.js#331)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:601)
at net.sourceforge.htmlunit.corejs.javascript.Context.call(Context.java:537)
at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.call(ContextFactory.java:538)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.execute(JavaScriptEngine.java:499)
at com.gargoylesoftware.htmlunit.html.HtmlPage.loadExternalJavaScriptFile(HtmlPage.java:970)
at com.gargoylesoftware.htmlunit.html.HtmlScript.executeScriptIfNeeded(HtmlScript.java:363)
at com.gargoylesoftware.htmlunit.html.HtmlScript$1.execute(HtmlScript.java:225)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.doProcessPostponedActions(JavaScriptEngine.java:644)
... 85 more
Caused by: net.sourceforge.htmlunit.corejs.javascript.EcmaError: TypeError: Cannot find function createElement in object [object]. (http://cnc.qzs.qq.com/ac/qzone/qzfl/qzfl_2.0.9.0.js#331)
at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3772)
at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3750)
at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.typeError(ScriptRuntime.java:3778)
at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.typeError2(ScriptRuntime.java:3797)
at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.notFunctionError(ScriptRuntime.java:3861)
at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.getPropFunctionAndThisHelper(ScriptRuntime.java:2346)
at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.getPropFunctionAndThis(ScriptRuntime.java:2313)
at net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpretLoop(Interpreter.java:1515)
at net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpret(Interpreter.java:845)
at net.sourceforge.htmlunit.corejs.javascript.InterpretedFunction.call(InterpretedFunction.java:164)
at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.doTopCall(ContextFactory.java:429)
at com.gargoylesoftware.htmlunit.javascript.HtmlUnitContextFactory.doTopCall(HtmlUnitContextFactory.java:269)
at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3162)
at net.sourceforge.htmlunit.corejs.javascript.InterpretedFunction.exec(InterpretedFunction.java:175)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$3.doRun(JavaScriptEngine.java:490)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:595)
... 92 more
BUILD SUCCESSFUL
14.6k105866
I wouldn't really call this an answer but assuming the problem is Javascript detection and management in HTMLUnit
1) htmlunit is open source, so you should be able to configure it to accept application/x-javascript as JavaScript
2) if you control the server, the mime type is configured by the server there and you may find it easier to make the change on the server.
Just use webclient.setJavaScriptEnabled(false);
It worked for me hope it helps you.sorry for delaying the answer.
175k43266332
I was receiving error similar to this,then i changed the browser version it helped.So just try different browser versions
Your Answer
Sign up or
Sign up using Google
Sign up using Facebook
Post as a guest
Post as a guest
By posting your answer, you agree to the
Not the answer you're looking for?
Browse other questions tagged
Upcoming Events
ends Mar 27
Stack Overflow works best with JavaScript enabled

我要回帖

更多关于 tv版的android app 的文章

 

随机推荐