Here you can find the source of getHtmlSource(final String host)
private static String getHtmlSource(final String host)
//package com.java2s; //License from project: Open Source License import java.net.*; import java.io.*; public class Main { private static String getHtmlSource(final String host) { final StringBuilder sb = new StringBuilder(); InputStream is;/* w ww.j a va2 s . c o m*/ try { final URL url = new URL(host); is = url.openStream(); final BufferedReader br = new BufferedReader(new InputStreamReader(is)); String line; while ((line = br.readLine()) != null) { sb.append(line); } } catch (MalformedURLException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } return sb.toString(); } }