Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static String getHTML(String addr)
- {
- URL url;
- HttpURLConnection conn;
- BufferedReader rd;
- String line;
- String result = "";
- try {
- url = new URL(addr);
- conn = (HttpURLConnection) url.openConnection();
- conn.setRequestMethod("GET");
- rd = new BufferedReader(new InputStreamReader(conn.getInputStream()));
- while ((line = rd.readLine()) != null) {
- result += line;
- }
- rd.close();
- } catch (Exception e) {
- e.printStackTrace();
- }
- return result;
- }
Advertisement
Add Comment
Please, Sign In to add comment