Return to Snippet

Revision: 35430
at November 8, 2010 09:57 by mouseroot


Updated Code
import java.net.*;
import java.io.*;

class ...

static URL url;
static URLConnection urlc;
static BufferedReader br;
static String line;

... public static void main(String args[])

try {

url = new URL("Http://website.tld");
urlc = url.openConnection();
br = new BufferedReader(new InputStreamReader(urlc.getInputStream()));
while((line = br.readLine()) != null)
{
System.out.println(line);
}

} catch(Exception e) {
System.out.println("There was an error in your URL!");
}

Revision: 35429
at November 8, 2010 09:56 by mouseroot


Initial Code
import java.net.*;
import java.io.*;

class ...

static URL url;
static URLConnection urlc;
static BufferedReader br;
static String line;

try {

url = new URL("Http://website.tld");
urlc = url.openConnection();
br = new BufferedReader(new InputStreamReader(urlc.getInputStream()));
while((line = br.readLine()) != null)
{
System.out.println(line);
}

} catch(Exception e) {
System.out.println("There was an error in your URL!");
}

Initial URL

                                

Initial Description
Java Read Site Source code Line by Line :D

Initial Title
Java Read site source line by line

Initial Tags

                                

Initial Language
Java