Solved

Post Data problem - ciuly if u can help me with this cuz u have helped me once on this prob.

Posted on 2006-06-12
11
332 Views
Last Modified: 2010-04-05
Hi,

I want to get the results from http://www.abebooks.com/servlet/SearchEntry. Well it was working by 2 days ago and suddently I`m not sure what happened, maybe they added cookies to the page ?
I need a procedure just to get the results, I`ll change the params later.

Thanks
0
Comment
Question by:crystyan
  • 6
  • 5
11 Comments
 
LVL 28

Expert Comment

by:ciuly
ID: 16886493
I don't remeber this page. sorry. can you post your code? I'd hate to spend 30 min doing a test app :)

what I want to emphasis:
- you have a few hidden inputs: you must send them as well (in case you didn't)
- you also have some fields that MUST be sent (see the * in the page)
- make sure that the "cty" select has correct value (from that list)

also, would have been helpfull to send the error message that you get ;)
0
 

Author Comment

by:crystyan
ID: 16886524
 params := 'sts=t&an=&pn=&tn=&yrl=&yrh=1962&isbn=&prl=&prh=&kn=' +
    keyword + '&cty=200000237&bx=off&bi=0&sortby=' + Op.Sort +
    '&fe=off&sgnd=off&dj=off&ds=50';

  PostData('http://dogbert.abebooks.com/servlet/SearchResults', params, true);
0
 
LVL 28

Expert Comment

by:ciuly
ID: 16886587
could you post the code for PostData procedure?
0
 

Author Comment

by:crystyan
ID: 16886618
www.cristianignat.com/diverse/TIE_http_https_build_046.zip - this is the componenet.

the procedure:
  IEHTTP1.URL := url + '?' + params;

  IEHTTP1.RequestMethod := 'POST';

  try
    IEHTTP1.Execute;

    HTML := IEHTTP1.sl.Text;
  except
    on E:Exception do
    begin
      HTML := '<<ERROR>>';
      MessageDlg(#13 + 'Connection error. Either one of the used server is down, either your internet connection is down.', mtWarning, [mbOk], 0);
    end;
  end;
0
 
LVL 28

Accepted Solution

by:
ciuly earned 500 total points
ID: 16886876
well .. I didn't get those sources :D I preferred to work with indy. so after I failed to get the data using normal operations, I started to debug the process and noticed that there was as redirect ot an url that contained the same domain/paath but the params were added. probably some ugly hack on their site, because then I made a get on that url directly and it worked just fine :)

here is the code:
var params:string;
begin
  idhttp1.HandleRedirects:=true;
  params := 'sts=t&an=&pn=&tn=&yrl=&yrh=1962&isbn=&prl=&prh=&kn=' +
    'test' + '&cty=200000237&bx=off&bi=0&sortby=' + '0' +
    '&fe=off&sgnd=off&dj=off&ds=50';
  memo1.lines.text:=idhttp1.get('http://www.abebooks.com/servlet/SearchResults?'+params);
end;
 
I used "test" keyword and sort of "0"
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 28

Expert Comment

by:ciuly
ID: 16886884
oh, and btw, you got the post url wrong :)
0
 

Author Comment

by:crystyan
ID: 16886988
THANKS !
me being soooo dumb!
0
 
LVL 28

Expert Comment

by:ciuly
ID: 16887331
I have to disagree with that. I am doing such mistakes pretty often (considering that I usually work on projects even after 2 am). I like to believe that I am not paying enough attention or I am distracted :D (which is true)

peace
0
 

Author Comment

by:crystyan
ID: 16944195
sorry I forgot to accept ur answer lol.

I just wanted to post a new question for u. and saw this. I`ll accept it now...sorry again ciuly :-)

I hope YOU can answer on my next question, pls ...

Thanks
0
 
LVL 28

Expert Comment

by:ciuly
ID: 16944922
no problem. I'll try and see if I can make something out of it
0
 

Author Comment

by:crystyan
ID: 16944963
thanks
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now