Results 1 to 2 of 2
  1. #1
    gdrsantosh is offline Member
    Join Date
    Oct 2014
    Rep Power

    Default How to handle ajax calls using HttpClient

    I'm using following code to get pagecontent. But unfortunately i'm not able to get data which is within the table.

    HttpGet httget = new HttpGet("");
    HttpClient httpclient = new DefaultHttpClient();
    HttpResponse response = httpclient.execute(httget);
    HttpEntity entity = response.getEntity();
    String thirdPartyPageContent=EntityUtils.toString(entity) ;

    but if you enter the url directly in browser I get all the data in table. My understanding is to make ajax call it takes some time. But our httpclient is not waiting for the same.
    please help me in getting the table page content.

  2. #2
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Rep Power

    Default Re: How to handle ajax calls using HttpClient

    If there's an Ajax call then HttpClient is no use to you as it simply handles a basic http request and response and does no extra work beyond that.

    You might find something like HttpUnit or Selenium more useful, as they will mimic a browser. Not sure whether they would suit your requirements, though.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

Similar Threads

  1. Corn Httpclient 0.1
    By java software in forum Java Software
    Replies: 0
    Last Post: 06-16-2013, 08:40 AM
  2. HTTPClient Error
    By fowell in forum Advanced Java
    Replies: 2
    Last Post: 12-17-2012, 12:24 PM
  3. Using HttpClient
    By jdetloff in forum New To Java
    Replies: 4
    Last Post: 01-06-2010, 11:43 AM
  4. Using HttpClient with Eclipse
    By jdetloff in forum Eclipse
    Replies: 4
    Last Post: 01-06-2010, 10:47 AM
  5. Getting httpclient working with eclipse.
    By int80 in forum Eclipse
    Replies: 4
    Last Post: 03-31-2009, 02:17 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts