Solved

Searching Web

Posted on 2003-11-04
9
249 Views
Last Modified: 2010-04-05
Hello . Im using Delphi 6 , and i want to make a search in a web page ... and it will return me some variables ... i think i have to use nmhttp ... the site will be like google .. so i ll type the search word in a edit and it will return me some variables like url and other in a memo ... thnx a lot
0
Comment
Question by:fuscao_sp
  • 5
  • 4
9 Comments
 
LVL 5

Expert Comment

by:DeerBear
ID: 9686056
Hi,

Use that page for a bit as user and study how they pass the search query, via Post or Get.
Use TIdHTTP to do the query in either case.

HTH,

Andrew

P.S. For further help, please specify the page.
0
 

Author Comment

by:fuscao_sp
ID: 9690367
hi i wanna make a search in www.imdb.com for my catalog in my video store ...
i wanna search the movie that will be typed in an edit .. and in a memo it will return genre , tagline , votes , rating , plot and cast .. then after i can treat it and add to my db ...
0
 
LVL 5

Expert Comment

by:DeerBear
ID: 9692560
URL: http://www.imdb/find

Parameters:

POST

- 1 parameter containing the type( chosen among the ones displayed ) and called "Select".
- 1 parameter containing the name and called "For".

Use TIdHttp for it.

HTH,

Andrew
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:fuscao_sp
ID: 9696140
theres no chance you can post here an "trial" code so i can try to upgrade it ??? thnx a loot
0
 

Author Comment

by:fuscao_sp
ID: 9696979
im having some problems to filter the data i reciveid ... can you help ??? thnx in advance
0
 
LVL 5

Expert Comment

by:DeerBear
ID: 9699698
Hi,

I'll try to post something tomorrow morning, ok?
I don't have a chance to try things out for today.

Or, send in the code you tried, so that we'll give a
look at it together.

Cheers,

Andrew
0
 

Author Comment

by:fuscao_sp
ID: 9704870
i have this to get rating year and name from a idtitle page ...

memo1.lines.Text:=HTTP.Get(Edit1.text);
title1:=copy(memo1.Lines.text,pos('"title">',memo1.lines.text)+8,length(memo1.lines.text));
title1:=copy(title1,0,pos('<small>(<a href="',title1)-2);
year:=copy(memo1.Lines.text,pos('"title">',memo1.lines.text)+8,length(memo1.lines.text));
year:=copy(year,pos(Title1,year)+length(title1),length(year));
year:=copy(year,0,pos('</strong>',year));
year:=copy(year,pos(' <small>(<a href="/Sections/Years/',year)+34,length(year));
year:=copy(year,0,pos('</a>)</small>',year)-1);
year:=copy(year,0,pos('"',year)-1);
rating:=copy(memo1.Lines.text,pos('<b class="ch">User Rating:</b>',memo1.lines.text)+32,length(memo1.lines.text));
rating:=copy(rating,0,pos('alt="Vote Here" align="bottom"',rating)-34);
rating:=copy(rating,0,pos('<a href="ratings"><img',rating)-2);
rating:=copy(rating,pos('<b>',rating),pos('votes)',rating)-1);
rating1:=copy(rating,pos('<b>',rating)+3,pos('</b>',rating)-4);
rating2:=copy(rating,pos('</b> ',rating)+5,length(rating)+4);;

now i want to get writed by, plot info and hole cat ... but i cant hehehe ... thnx in advance ;)
0
 
LVL 5

Accepted Solution

by:
DeerBear earned 100 total points
ID: 9712993
Hi,

Well, I gave an eye to the Post method in the IdHTTP component.
It's overloaded, so you have several versions, but in all of them there's a
string list parameter.

You can do something like this:

var Params : TStringList;

begin
 
   Params := TStringList.Create;
   Params.Add( 'SELECT='+Selection );
   Params.Add( 'FOR='+Title );
   IdHttp1.Post(...,Params,nil );

end;

Use a TStream in the third param if you want to get a result back.

HTH,

Andrew
0
 

Author Comment

by:fuscao_sp
ID: 9715474
ok i ll accept it ;) but can you be more specific on how to get result back ??? im trying with no sucess getting cast and plot info .... the pages are not equal on diferent movies and what i tried doesnt work ... its like i post before ... thnx
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
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…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

735 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