• Non ci sono risultati.

Web Page Downloader

N/A
N/A
Protected

Academic year: 2021

Condividi "Web Page Downloader"

Copied!
1
0
0

Testo completo

(1)

import java.net.*;

import java.io.*;

/**

* Write a description of class WpageDownloader here.

* Web page downloader * @author (your name)

* @version (a version number or a date) */

public class WpageDownloader {

public static void main(String[] args){

try {

URL url = new URL("http://www.google.it/");

HttpURLConnection connection = (HttpURLConnection) url.openConnection();

BufferedReader read = new BufferedReader(new InputStreamReader(connection.getInputStream()));

String line = read.readLine();

String html ="";

while(line!=null) { html +=line+'\n';

line = read.readLine();

}

System.out.println(html);

} catch(MalformedURLException ex) { ex.printStackTrace();

} catch(IOException ioex) { ioex.printStackTrace();

} } }

Riferimenti

Documenti correlati

[r]

Repertorio Determine n...

[r]

[r]

Repertorio Delibere n...

Repertorio Delibere n...

[r]

[r]