how to get the content from an URL?  
Author Message
hernan.rancati





PostPosted: 2005-4-14 14:44:00 Top

java-programmer, how to get the content from an URL? Hi people,

I have write some code that outputs the content of an URL in
System.out,
which is really trivial using the following code:


URL url=new URL("http://www.some-url.com");
URLConnection c=url.openConnection();
BufferedReader is=new BufferedReader(new
InputStreamReader(c.getInputStream()));

String line;
while ((line=is.readLine())!=null) {
System.out.println("line: "+line);
}


But, some URLs have javascript code embedded that redirects the page
or refills
it in some way when it's automatically run by the browser. I want to
have the HTML code after executing that javascript code, exactly as
you can get it from your internet browser's "view source-code", not as
I'am getting it by now.

The cuestion is...

there is ANY workaround to this issue? some way to run javascripted
pages from
java? some way to deliver it to a web browser, or something nicer?

thanks to everyone,

hernan rancati, cesare.