Here you can find the source of getText(String url)
public static String getText(String url) throws Exception
//package com.java2s; //License from project: Creative Commons License import java.net.*; import java.io.*; public class Main { public static String getText(String url) throws Exception { URL website = new URL(url); URLConnection connection = website.openConnection(); BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream(), "iso-8859-2")); StringBuilder response = new StringBuilder(); String inputLine;/*from w w w . j a va 2s . c o m*/ while ((inputLine = in.readLine()) != null) response.append(inputLine); in.close(); return response.toString(); } }