Package Torello.Browser
Class ReadAPI
- java.lang.Object
-
- Torello.Browser.ReadAPI
-
public class ReadAPI extends java.lang.Object
Hi-Lited Source-Code:- View Here: Torello/Browser/ReadAPI.java
- Open New Browser-Tab: Torello/Browser/ReadAPI.java
File Size: 1,207 Bytes Line Count: 35 '\n' Characters Found
-
-
Constructor Summary
Constructors Constructor ReadAPI()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method static StringreadAPIFromServer(Integer port)
-
-
-
Constructor Detail
-
ReadAPI
public ReadAPI()
-
-
Method Detail
-
readAPIFromServer
public static java.lang.String readAPIFromServer(java.lang.Integer port) throws java.io.IOException
You may use this method (if you so choose, for whatever reason) to retrieve the Remote Debugging Port API from Google. This method will return a (very long) JSON-File, as ajava.lang.String- Parameters:
port- This should be the port that was used to start the server. This is, by default, port9223.- Returns:
- A very-long JSON-
Stringcontaining the currently-exported API that your web-browser provides. - Throws:
java.io.IOException- If there are problems sending this request, or retrieving the response, this throws.- Code:
- Exact Method Body:
if (port == null) port = 9222; final String urlStr = "http://127.0.0.1:" + port + "/json/protocol"; final URL url = new URL(urlStr); System.out.println("Querying WS Server for JSON\n" + url); // NOTE: This is a very large JSON File - more than 20,000 lines of text return Scrape.scrapePage(url);
-
-