Solved

Searching Web

Posted on 2003-11-04
9
245 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
 

Author Comment

by:fuscao_sp
Comment Utility
theres no chance you can post here an "trial" code so i can try to upgrade it ??? thnx a loot
0
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 

Author Comment

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

Expert Comment

by:DeerBear
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

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…
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…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

763 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

12 Experts available now in Live!

Get 1:1 Help Now