Hi,
I am trying to run the the example on http://lobobrowser.org/cobra/java-html-parser.jsp called Simulation of form submission. When I override the isScriptingEnabled() method so that javascript is enabled, I run into problems. It always fails with the following. I have modified the source to do a simple html parse of a google search results.
May28,20108:35:59PMorg.lobobrowser.js.JavaFunctionObjectcallINFO: call():CallingmethodsetTimeoutonobjectorg.lobobrowser.html.js.Window@4f5ad5c6oftypeorg.lobobrowser.html.js.WindowMay28,20108:35:59PMorg.lobobrowser.js.JavaFunctionObjectcallINFO: call():Formethod=setTimeout: Convertedarg=org.mozilla.javascript.InterpretedFunction@9d7fbfb(type=org.mozilla.javascript.InterpretedFunction)intoactualArg=function_gjp() {!(window._gjwl.hash&&window._gjuc())&&setTimeout(_gjp,500);}.Typeexpectedbymethodisjava.lang.String.May28,20108:35:59PMorg.lobobrowser.js.JavaFunctionObjectcallINFO: call():Formethod=setTimeout: Convertedarg=500.0(type=java.lang.Double)intoactualArg=500.0.Typeexpectedbymethodisdouble.May28,20108:35:59PMorg.lobobrowser.html.domimpl.HTMLScriptElementImplprocessScriptINFO: addNotify():Evaluated(orattemptedtoevaluate)Javascriptin80ms.http://www.google.co.uk/ [1:1103] Error in style rule. Invalid token "-". Was expecting one of: <S>, "}", ";", <IDENT>.http://www.google.co.uk/ [1:1103] Ignoring the following declarations in this rule.http://www.google.co.uk/ [1:1528] Error in style rule. Invalid token ":". Was expecting one of: <S>, "}", ",", ";", "/", "+", "-", <HASH>, <STRING>, <URI>, <IMPORTANT_SYM>, "inherit", <EMS>, <EXS>, <LENGTH_PX>, <LENGTH_CM>, <LENGTH_MM>, <LENGTH_IN>, <LENGTH_PT>, <LENGTH_PC>, <ANGLE_DEG>, <ANGLE_RAD>, <ANGLE_GRAD>, <TIME_MS>, <TIME_S>, <FREQ_HZ>, <FREQ_KHZ>, <DIMEN>, <PERCENTAGE>, <NUMBER>, "rgb(", <FUNCTION>, <IDENT>, <UNICODERANGE>.http://www.google.co.uk/ [1:1528] Ignoring the following declarations in this rule.May28,20108:35:59PMorg.lobobrowser.html.domimpl.HTMLScriptElementImplprocessScriptINFO: addNotify():Evaluated(orattemptedtoevaluate)Javascriptin20ms.May28,20108:35:59PMorg.lobobrowser.js.JavaFunctionObjectcallINFO: call():CallingmethodgetElementByIdonobject#documentoftypeorg.lobobrowser.html.domimpl.HTMLDocumentImplMay28,20108:35:59PMorg.lobobrowser.js.JavaFunctionObjectcallINFO: call():Formethod=getElementById: Convertedarg=pmocntr(type=java.lang.String)intoactualArg=pmocntr.Typeexpectedbymethodisjava.lang.String.May28,20108:35:59PMorg.lobobrowser.js.JavaObjectWrappergetDefaultValueINFO: getDefaultValue():hint=classjava.lang.String,this=div[id=pmocntr,class=pmoabs][currentStyle=ComputedCSS2Properties[size=21]]May28,20108:35:59PMorg.lobobrowser.html.domimpl.HTMLScriptElementImplprocessScriptINFO: addNotify():Evaluated(orattemptedtoevaluate)Javascriptin96ms.May28,20108:35:59PMorg.lobobrowser.js.JavaFunctionObjectcallINFO: call():CallingmethodgetElementByIdonobject#documentoftypeorg.lobobrowser.html.domimpl.HTMLDocumentImplMay28,20108:35:59PMorg.lobobrowser.js.JavaFunctionObjectcallINFO: call():Formethod=getElementById: Convertedarg=shf0(type=java.lang.String)intoactualArg=shf0.Typeexpectedbymethodisjava.lang.String.May28,20108:35:59PMorg.lobobrowser.js.JavaObjectWrappergetDefaultValueINFO: getDefaultValue():hint=classjava.lang.String,this=p[id=shf0,style=display:none;behavior:url(#default#homePage)][currentStyle=ComputedCSS2Properties[size=1]]May28,20108:35:59PMorg.lobobrowser.html.domimpl.HTMLScriptElementImplprocessScriptINFO: addNotify():Evaluated(orattemptedtoevaluate)Javascriptin6ms.May28,20108:35:59PMorg.lobobrowser.js.JavaFunctionObjectcallINFO: call():CallingmethodsetTimeoutonobjectorg.lobobrowser.html.js.Window@4f5ad5c6oftypeorg.lobobrowser.html.js.WindowMay28,20108:35:59PMorg.lobobrowser.js.JavaFunctionObjectcallINFO: call():Formethod=setTimeout: Convertedarg=org.mozilla.javascript.InterpretedFunction@3f3f210f(type=org.mozilla.javascript.InterpretedFunction)intoactualArg=function(){vara=document.createElement("script");a.src="/extern_js/f/CgJlbhICdWsgACswCjhoQB0sKzAOOA8sKzAWOBYsKzAXOAcsKzAYOAUsKzAZOCAsKzAlOMqIASwrMCY4CywrMCc4BCwrMDw4AiwrMEA4ECwrMEE4BSwrMEU4ASwrME44BSwrMFE4AiwrMFo4ACyAAhM/GXyfTHjBjU8.js";(document.getElementById("xjsd")||document.body).appendChild(a);if(google.timers&&google.timers.load.t){google.timers.load.t.xjsls=(newDate).getTime();}}.Typeexpectedbymethodisjava.lang.String.May28,20108:35:59PMorg.lobobrowser.js.JavaFunctionObjectcallINFO: call():Formethod=setTimeout: Convertedarg=0.0(type=java.lang.Double)intoactualArg=0.0.Typeexpectedbymethodisdouble.May28,20108:35:59PMorg.lobobrowser.html.domimpl.HTMLScriptElementImplprocessScriptINFO: addNotify():Evaluated(orattemptedtoevaluate)Javascriptin4ms.May28,20108:35:59PMorg.lobobrowser.js.JavaFunctionObjectcallINFO: call():CallingmethodgetElementsByTagNameonobject#documentoftypeorg.lobobrowser.html.domimpl.HTMLDocumentImplMay28,20108:35:59PMorg.lobobrowser.js.JavaFunctionObjectcallINFO: call():Formethod=getElementsByTagName: Convertedarg=img(type=java.lang.String)intoactualArg=img.Typeexpectedbymethodisjava.lang.String.May28,20108:35:59PMorg.lobobrowser.html.js.WindowevalINFO: eval():javascriptfollows...function(){vara=document.createElement("script");a.src="/extern_js/f/CgJlbhICdWsgACswCjhoQB0sKzAOOA8sKzAWOBYsKzAXOAcsKzAYOAUsKzAZOCAsKzAlOMqIASwrMCY4CywrMCc4BCwrMDw4AiwrMEA4ECwrMEE4BSwrMEU4ASwrME44BSwrMFE4AiwrMFo4ACyAAhM/GXyfTHjBjU8.js";(document.getElementById("xjsd")||document.body).appendChild(a);if(google.timers&&google.timers.load.t){google.timers.load.t.xjsls=(newDate).getTime();}}May28,20108:35:59PMorg.lobobrowser.js.JavaObjectWrappergetDefaultValueINFO: getDefaultValue():hint=classjava.lang.String,this=img[class=pmoc,onclick=cpc(),src=/images/close_sm.gif,border=0][currentStyle=ComputedCSS2Properties[size=2]]May28,20108:35:59PMorg.lobobrowser.html.domimpl.HTMLScriptElementImplprocessScriptWARNING: Javascripterroratnull:0: TypeError:CannotfindfunctionattachEventinobjectimg[class=pmoc,onclick=cpc(),src=/images/close_sm.gif,border=0][currentStyle=ComputedCSS2Properties[size=2]].org.mozilla.javascript.EcmaError: TypeError:CannotfindfunctionattachEventinobjectimg[class=pmoc,onclick=cpc(),src=/images/close_sm.gif,border=0][currentStyle=ComputedCSS2Properties[size=2]].atorg.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3654)atorg.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3632)atorg.mozilla.javascript.ScriptRuntime.typeError(ScriptRuntime.java:3660)atorg.mozilla.javascript.ScriptRuntime.typeError2(ScriptRuntime.java:3679)atorg.mozilla.javascript.ScriptRuntime.notFunctionError(ScriptRuntime.java:3743)atorg.mozilla.javascript.ScriptRuntime.getPropFunctionAndThisHelper(ScriptRuntime.java:2247)atorg.mozilla.javascript.ScriptRuntime.getPropFunctionAndThis(ScriptRuntime.java:2214)atorg.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:3143)atorg.mozilla.javascript.Interpreter.interpret(Interpreter.java:2487)atorg.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:164)atorg.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:398)atorg.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3065)atorg.mozilla.javascript.InterpretedFunction.exec(InterpretedFunction.java:175)atorg.mozilla.javascript.Context.evaluateString(Context.java:1104)atorg.lobobrowser.html.domimpl.HTMLScriptElementImpl.processScript(HTMLScriptElementImpl.java:192)atorg.lobobrowser.html.domimpl.HTMLScriptElementImpl.setUserData(HTMLScriptElementImpl.java:110)atorg.lobobrowser.html.parser.HtmlParser.parseToken(HtmlParser.java:755)atorg.lobobrowser.html.parser.HtmlParser.parseToken(HtmlParser.java:678)atorg.lobobrowser.html.parser.HtmlParser.parseToken(HtmlParser.java:678)atorg.lobobrowser.html.parser.HtmlParser.parseToken(HtmlParser.java:678)atorg.lobobrowser.html.parser.HtmlParser.parse(HtmlParser.java:537)atorg.lobobrowser.html.parser.HtmlParser.parse(HtmlParser.java:507)atorg.lobobrowser.html.domimpl.HTMLDocumentImpl.load(HTMLDocumentImpl.java:386)atorg.lobobrowser.html.domimpl.HTMLDocumentImpl.load(HTMLDocumentImpl.java:366)atorg.lobobrowser.html.parser.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:98)atcom.consoleDeals.games.stats.gateway.Google$LocalHtmlRendererContext.submitForm(Google.java:311)atcom.consoleDeals.games.stats.gateway.Google$LocalHtmlRendererContext.submitForm(Google.java:296)atcom.consoleDeals.games.stats.gateway.Google$LocalHtmlRendererContext.navigate(Google.java:186)atcom.consoleDeals.games.stats.gateway.Google.main(Google.java:62)May28,20108:35:59PMorg.lobobrowser.js.JavaFunctionObjectcallINFO: call():Callingmethodfocusonobjectinput[title=GoogleSearch,maxlength=2048,style=background:#fff;border:1pxsolid#ccc;border-bottom-color:#999;border-right-color:#999;color:#000;font:18pxarial,sans-serifbold;height:25px;margin:0;padding:5px8px06px;vertical-align:top,name=q,value=,class=lst,autocomplete=off,size=57][currentStyle=ComputedCSS2Properties[size=3]]oftypeorg.lobobrowser.html.domimpl.HTMLInputElementImplMay28,20108:35:59PMorg.lobobrowser.html.js.WindowevalINFO: eval():javascriptfollows...function_gjp() {!(window._gjwl.hash&&window._gjuc())&&setTimeout(_gjp,500);}May28,20108:35:59PMorg.lobobrowser.html.domimpl.HTMLScriptElementImplprocessScriptINFO: addNotify():Evaluated(orattemptedtoevaluate)Javascriptin6ms.http://www.google.co.uk/search?btnG.x=1&btnG.y=1&hl=en&source=hp&ie=ISO-8859-1&q=java [1:4103] Error in style rule. Invalid token "*". Was expecting one of: <S>, "}", ";", <IDENT>.http://www.google.co.uk/search?btnG.x=1&btnG.y=1&hl=en&source=hp&ie=ISO-8859-1&q=java [1:4103] Ignoring the following declarations in this rule.http://www.google.co.uk/search?btnG.x=1&btnG.y=1&hl=en&source=hp&ie=ISO-8859-1&q=java [1:4522] Error in style rule. Invalid token "-". Was expecting one of: <S>, "}", ";", <IDENT>.http://www.google.co.uk/search?btnG.x=1&btnG.y=1&hl=en&source=hp&ie=ISO-8859-1&q=java [1:4522] Ignoring the following declarations in this rule.http://www.google.co.uk/search?btnG.x=1&btnG.y=1&hl=en&source=hp&ie=ISO-8859-1&q=java [1:6098] Error in expression. Invalid token ";". Was expecting one of: <S>, "+", "-", <HASH>, <STRING>, <URI>, "inherit", <EMS>, <EXS>, <LENGTH_PX>, <LENGTH_CM>, <LENGTH_MM>, <LENGTH_IN>, <LENGTH_PT>, <LENGTH_PC>, <ANGLE_DEG>, <ANGLE_RAD>, <ANGLE_GRAD>, <TIME_MS>, <TIME_S>, <FREQ_HZ>, <FREQ_KHZ>, <DIMEN>, <PERCENTAGE>, <NUMBER>, "rgb(", <FUNCTION>, <IDENT>, <UNICODERANGE>.May28,20108:36:00PMorg.lobobrowser.html.domimpl.HTMLScriptElementImplprocessScriptINFO: addNotify():Evaluated(orattemptedtoevaluate)Javascriptin3ms.May28,20108:36:00PMorg.lobobrowser.js.JavaFunctionObjectcallINFO: call():CallingmethodsetTimeoutonobjectorg.lobobrowser.html.js.Window@4f5ad5c6oftypeorg.lobobrowser.html.js.WindowMay28,20108:36:00PMorg.lobobrowser.js.JavaFunctionObjectcallINFO: call():Formethod=setTimeout: Convertedarg=org.mozilla.javascript.InterpretedFunction@39ed1b0b(type=org.mozilla.javascript.InterpretedFunction)intoactualArg=function(){vara=document.createElement("script");a.src="/extern_js/f/CgJlbhICdWsgACswCjhoQB0sKzAOOA8sKzAWOBYsKzAXOAcsKzAYOAUsKzAZOCAsKzAlOMqIASwrMCY4CywrMCc4BCwrMDw4AiwrMEA4ECwrMEE4BSwrMEU4ASwrME44BSwrMFE4AiwrMFo4ACyAAhM/GXyfTHjBjU8.js";(document.getElementById("xjsd")||document.body).appendChild(a);if(google.timers&&google.timers.load.t){google.timers.load.t.xjsls=(newDate).getTime();}}.Typeexpectedbymethodisjava.lang.String.May28,20108:36:00PMorg.lobobrowser.js.JavaFunctionObjectcallINFO: call():Formethod=setTimeout: Convertedarg=0.0(type=java.lang.Double)intoactualArg=0.0.Typeexpectedbymethodisdouble.May28,20108:36:00PMorg.lobobrowser.html.domimpl.HTMLScriptElementImplprocessScriptINFO: addNotify():Evaluated(orattemptedtoevaluate)Javascriptin7ms.May28,20108:36:00PMorg.lobobrowser.html.js.WindowevalINFO: eval():javascriptfollows...function(){vara=document.createElement("script");a.src="/extern_js/f/CgJlbhICdWsgACswCjhoQB0sKzAOOA8sKzAWOBYsKzAXOAcsKzAYOAUsKzAZOCAsKzAlOMqIASwrMCY4CywrMCc4BCwrMDw4AiwrMEA4ECwrMEE4BSwrMEU4ASwrME44BSwrMFE4AiwrMFo4ACyAAhM/GXyfTHjBjU8.js";(document.getElementById("xjsd")||document.body).appendChild(a);if(google.timers&&google.timers.load.t){google.timers.load.t.xjsls=(newDate).getTime();}}May28,20108:36:00PMorg.lobobrowser.js.JavaFunctionObjectcallINFO: call():CallingmethodgetElementsByTagNameonobject#documentoftypeorg.lobobrowser.html.domimpl.HTMLDocumentImplMay28,20108:36:00PMorg.lobobrowser.js.JavaFunctionObjectcallINFO: call():Formethod=getElementsByTagName: Convertedarg=img(type=java.lang.String)intoactualArg=img.Typeexpectedbymethodisjava.lang.String.May28,20108:36:00PMorg.lobobrowser.js.JavaObjectWrappergetDefaultValueINFO: getDefaultValue():hint=classjava.lang.String,this=img[height=222,src=/images/srpr/nav_logo13.png,alt=,width=167][currentStyle=ComputedCSS2Properties[size=12]]May28,20108:36:00PMorg.lobobrowser.html.domimpl.HTMLScriptElementImplprocessScriptWARNING: Javascripterroratnull:0: TypeError:CannotfindfunctionattachEventinobjectimg[height=222,src=/images/srpr/nav_logo13.png,alt=,width=167][currentStyle=ComputedCSS2Properties[size=12]].org.mozilla.javascript.EcmaError: TypeError:CannotfindfunctionattachEventinobjectimg[height=222,src=/images/srpr/nav_logo13.png,alt=,width=167][currentStyle=ComputedCSS2Properties[size=12]].atorg.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3654)atorg.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3632)atorg.mozilla.javascript.ScriptRuntime.typeError(ScriptRuntime.java:3660)atorg.mozilla.javascript.ScriptRuntime.typeError2(ScriptRuntime.java:3679)atorg.mozilla.javascript.ScriptRuntime.notFunctionError(ScriptRuntime.java:3743)atorg.mozilla.javascript.ScriptRuntime.getPropFunctionAndThisHelper(ScriptRuntime.java:2247)atorg.mozilla.javascript.ScriptRuntime.getPropFunctionAndThis(ScriptRuntime.java:2214)atorg.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:3143)atorg.mozilla.javascript.Interpreter.interpret(Interpreter.java:2487)atorg.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:164)atorg.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:398)atorg.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3065)atorg.mozilla.javascript.InterpretedFunction.exec(InterpretedFunction.java:175)atorg.mozilla.javascript.Context.evaluateString(Context.java:1104)atorg.lobobrowser.html.domimpl.HTMLScriptElementImpl.processScript(HTMLScriptElementImpl.java:192)atorg.lobobrowser.html.domimpl.HTMLScriptElementImpl.setUserData(HTMLScriptElementImpl.java:110)atorg.lobobrowser.html.parser.HtmlParser.parseToken(HtmlParser.java:755)atorg.lobobrowser.html.parser.HtmlParser.parseToken(HtmlParser.java:678)atorg.lobobrowser.html.parser.HtmlParser.parseToken(HtmlParser.java:678)atorg.lobobrowser.html.parser.HtmlParser.parse(HtmlParser.java:537)atorg.lobobrowser.html.parser.HtmlParser.parse(HtmlParser.java:507)atorg.lobobrowser.html.domimpl.HTMLDocumentImpl.load(HTMLDocumentImpl.java:386)atorg.lobobrowser.html.domimpl.HTMLDocumentImpl.load(HTMLDocumentImpl.java:366)atorg.lobobrowser.html.parser.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:98)atcom.consoleDeals.games.stats.gateway.Google$LocalHtmlRendererContext.submitForm(Google.java:311)atorg.lobobrowser.html.domimpl.HTMLFormElementImpl.submit(HTMLFormElementImpl.java:213)atcom.consoleDeals.games.stats.gateway.Google.main(Google.java:83)
I have downloaded the latest source code for rhino and cssparser, but these have made no real difference.
Can please someone help. I have spent another day trying to do this : (((
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I am trying to run the the example on http://lobobrowser.org/cobra/java-html-parser.jsp called Simulation of form submission. When I override the isScriptingEnabled() method so that javascript is enabled, I run into problems. It always fails with the following. I have modified the source to do a simple html parse of a google search results.
I have downloaded the latest source code for rhino and cssparser, but these have made no real difference.
Can please someone help. I have spent another day trying to do this : (((