Yar

Sign in to follow this  
  • entries
    208
  • comments
    383
  • views
    65546

Text Based Browser

Sign in to follow this  
H_o_p_s

91 views


import java.io.*;
import java.net.*;

public class getWebPage {
public static void main(String args[]) throws Exception {
URL url = new URL(args[0]);
InputStream in = url.openStream();
InputStreamReader isr = new InputStreamReader(in);
BufferedReader inline = new BufferedReader(isr);
String line;
int linecount = 0;
while((line = inline.readLine()) != null) {
linecount++;
System.out.println(line);
}
System.out.println("Total lines: " + linecount);
}
}




Going into java networking.... a simple html getter :)

java getWebPage http://www.google.com
Sign in to follow this  


0 Comments


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now