Re: links and js

<[email protected]>
Newsgroups gmane.comp.web.httpunit.devel
Message-ID <652366DEEF97A3438EC2F4669BD66BA54061BA@msgswbmnmsp31.wellsfargo.com>
michael gross asked:
> if I am running the fallowing lines
> 
> response = conversation.getResponse( "www.google.ch" );
> lk = response.getLinkWith("Personalisierte Startseite"); 
> response = lk.click(); System.out.println(response.getText());
> 
> I get the exception:
> 
> org.mozilla.javascript.JavaScriptException: 
> java.lang.NullPointerException
>    at
> org.mozilla.javascript.JavaScriptException.wrapException(JavaS
> criptException.java:70)
>    at 
> org.mozilla.javascript.FunctionObject.call(FunctionObject.java:418)
>    at 
> org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2169)
>    at 
		[snip]
>    at
> com.meterware.httpunit.WebWindow.getSubframeResponse(WebWindow
> .java:130)
>    at com.meterware.httpunit.WebWindow.getResponse(WebWindow.java:121)
>    at com.meterware.httpunit.WebWindow.sendRequest(WebWindow.java:110)
>    at
> com.meterware.httpunit.WebRequestSource.submitRequest(WebReque
> stSource.java:253)
>    at
> com.meterware.httpunit.WebRequestSource.submitRequest(WebReque
> stSource.java:232)
>    at com.meterware.httpunit.WebLink.click(WebLink.java:98)
>    at gourmondo.get_site(gourmondo.java:42)
>    at gourmondo.main(gourmondo.java:13)
> 
> 
> what could be the problem, that i can not open this page?

The problem is that the Rhino interpreter that HttpUnit uses for
Javascript can't handle something on that page.  Perhaps it's the fact
that there's no handler for videos, but there's so much javascript there
that I can't tell.

What are you trying to accomplish?  If you're just trying to use
HttpUnit to script some page scraping, there are probably tools out
there designed for that.

 - George
   http://www.idiacomputing.com/


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.