Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.io.*;
- import java.net.*;
- public class Lab3
- {
- public static String getHTML(String urlToRead) throws Exception
- {
- StringBuilder result = new StringBuilder();
- URL url = new URL(urlToRead);
- HttpURLConnection conn = (HttpURLConnection) url.openConnection();
- conn.setRequestMethod("GET");
- BufferedReader rd = new BufferedReader(new InputStreamReader(conn.getInputStream()));
- String line;
- while ((line = rd.readLine()) != null)
- {
- result.append(line);
- }
- rd.close();
- return result.toString();
- }
- public static void main(String[] args) throws Exception
- {
- System.out.println(getHTML("http://http://136.206.115.117:8080/IRModelGenerator/SearchServlet?query=bonediseasesimf=BM25k=1.2b=0.75numwanted=50"));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement