1 2 import java.io.*; 3 import java.net.URL; 4 5 public class WebsiteReader 6 { 7 public static BufferedReader read(String url) throws Exception{ 8 return new BufferedReader( 9 new InputStreamReader( 10 new URL(url).openStream()));} 11 12 public static void main (String[] args) throws Exception{ 13 BufferedReader reader = read(args[0]); 14 String line = reader.readLine(); 15 16 while (line != null) { 17 System.out.println(line); 18 line = reader.readLine(); }} 19 }
You need to create an account or log in to post comments to this site.