Class ReadAPI

    • Constructor Summary

      Constructors 
      Constructor
      ReadAPI()
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method
      static String readAPIFromServer​(Integer port)
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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 a java.lang.String
        Parameters:
        port - This should be the port that was used to start the server. This is, by default, port 9223.
        Returns:
        A very-long JSON-String containing 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);