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

    Default How to handle ajax calls using HttpClient

    Hi,
    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("http://pstweb.cloudapp.net/raselect/?tid=188J");
    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.
    Thanks

  2. #2
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    13,541
    Rep Power
    26

    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, 07:40 AM
  2. HTTPClient Error
    By fowell in forum Advanced Java
    Replies: 2
    Last Post: 12-17-2012, 11:24 AM
  3. Using HttpClient
    By jdetloff in forum New To Java
    Replies: 4
    Last Post: 01-06-2010, 10:43 AM
  4. Using HttpClient with Eclipse
    By jdetloff in forum Eclipse
    Replies: 4
    Last Post: 01-06-2010, 09:47 AM
  5. Getting httpclient working with eclipse.
    By int80 in forum Eclipse
    Replies: 4
    Last Post: 03-31-2009, 01: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
  •