String result = "";
Object content1 = new URL("http://www.baidu.com").getContent();
BufferedReader rd = new BufferedReader(new InputStreamReader(
(InputStream) content1));
while ((line = rd.readLine()) != null) {
result += line;
}
rd.close();
System.out.println(result);