Getting content from a webpage--help!
I am trying to get the hole html code from a webpage but I have a problem.
Here is part of the code:
final java.io.InputStream stream = conn.getErrorStream();
if ( stream != null )
content = readStream( length, stream );
else if ( (content = conn.getContent( )) != null &&
content instanceof java.io.InputStream )
content = readStream( length, (java.io.InputStream)content );
I also have a getContent method, that returns the content.
In the main method I get the content: Object content = file.getContent( );
And I print it : System.out.println(content);
For some webpages it works but for others it prints something like:
Does anyone know why this happens?
I can provide the whole code (wich I found in the internet) if needed