title: Selenium get HTML (or JSON) response from WebDriver
body: <p>I have the following code but its not working</p>
  
  <pre><code>public static String getHTMLResponse(String url){
     String body = (String) js.executeScript("$.ajax({url:\""+ url + "\", success:function(result){ return result;}});");
      return body;
  }
  </code></pre>
  
  <p>For some reason this is always returning null.</p>
  
  <p>Has anyone tried to get a CURL response from ajax in webdriver? I was doing this in java before but I am getting certificate errors constantly and just want something more reliable.</p>
  
  <p>Thanks ahead of time!</p>