title: Read data from webpage
body: <p>I am trying to read data from the given web page using Java.
  <code></p>
  
  <pre><code>public class WebpageReader {
      public static void main(String[] args) throws IOException {
          String line = null, response;
          URL url = new URL("http://www.google.co.in/");
          HttpURLConnection conn = (HttpURLConnection) url.openConnection();
          BufferedReader rd = new BufferedReader(new InputStreamReader(conn
                  .getInputStream()));
          while (rd.readLine() != null) {
              line += rd.readLine();
          }
          System.out.println(line);
  
      }
  }
  </code></pre>
  
  <p></code>
  But I'm getting the connection refused exception. What might be correct way to get the date from webpage?</p>