Tuesday, 5 January 2016

How to get HTML,CSS,SCRIPT code of a Web Side in JAVA?

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

public class TestCode
{
public static void main(String args[])throws Exception
{
URL yahoo = new URL(args[0]);
BufferedReader in = new BufferedReader(
            new InputStreamReader(
            yahoo.openStream()));

String inputLine;

while ((inputLine = in.readLine()) != null)
    System.out.println(inputLine);

in.close();
}
}

Compile it as....          javac  TestCode.java

Run it as ....              java TestCode  http://192.168.0.51/index.asp

No comments:

Post a Comment