Solved

Searching Web

Posted on 2003-11-04
9
247 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
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 

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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Suggested Solutions

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
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…

832 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