Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Searching Web

Posted on 2003-11-04
9
Medium Priority
?
254 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
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…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Suggested Courses

704 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