Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Searching Web

Posted on 2003-11-04
9
Medium Priority
?
255 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

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 200 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

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…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Screencast - Getting to Know the Pipeline
Suggested Courses

876 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