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

public class Sitecontent
{
public static void main (String[] args)
{
try
{
Scanner sc = new Scanner(System.in);
System.out.print("Enter Any URL : ");
String str = sc.next();
System.out.println("It's Your Website Contents : ");
System.out.println(" ");
System.out.println(" ");

URL u = new URL(str);
        InputStream in = u.openStream();
                in = new BufferedInputStream(in);      
                Reader r = new InputStreamReader(in);
        int c;
        while ((c = r.read()) != -1) 
        {
           System.out.print((char) c);        
         }
      }
      catch (MalformedURLException ex) 
       {
           System.err.println(" It is not a parseable URL");       
        }
      catch (IOException ex) 
       {
           System.err.println(ex);      
        }
     }

}


OUTPUT



Leave a Reply

Subscribe to Posts | Subscribe to Comments

All Notes on BCA

All Notes  on BCA
BCA all subjects notes

Total Pageviews

Translate

Powered by Blogger.

Copyright © All Notes on BCA