public static String downloadPage(String address) {
        URL url;
        try {
            url = new URL(address);
        } catch (MalformedURLException ex) {
            ex.printStackTrace();
            return null;
        }

        try {
            BufferedReader reader = new BufferedReader(new InputStreamReader(url.openConnection().getInputStream()));
            StringBuilder page = new StringBuilder();
            String line;
            while ((line = reader.readLine()) != null)
                page.append(line);
            return page.toString();
        } catch (IOException ex) {
            ex.printStackTrace();
            return null;
        }
    }