Jump to content
  • Advertisement

Yar

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

Text Based Browser

Sign in to follow this  
H_o_p_s

109 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
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!