S
SpreadTooThin
I want to download a website and store it in an html file.
I don't want to recurs all the links that might be in the site, but i
do want all the images and formatting that are displayed just as when
you visit the sight.
I think it should be as simple as:
URL url = new URL("http://example.com");
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
BufferedReader rd = new BufferedReader(new InputStreamReader
(conn.getInputStreamReader());
String line;
while(line=rd.readLine() != null)
{
response += line;
}
Will this work or is there more to be done?
I don't want to recurs all the links that might be in the site, but i
do want all the images and formatting that are displayed just as when
you visit the sight.
I think it should be as simple as:
URL url = new URL("http://example.com");
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
BufferedReader rd = new BufferedReader(new InputStreamReader
(conn.getInputStreamReader());
String line;
while(line=rd.readLine() != null)
{
response += line;
}
Will this work or is there more to be done?