I use this to search for "links I like" in a web site

  aLinksQueMeGustan : Array[0..0] of string = (
     'http://www.thisweb.com/ad'
    );

procedure TForm1.AnalizarLinksQueMeGustan;
var
  htmlDoc: IHTMLDocument2;
  allLinks: IHTMLElementCollection;
  firstLink: IHTMLElement;
  url: String;
  i,ii : integer ;
  lMeGusta : Boolean ;
begin
  htmlDoc := wb.Document as IHTMLDocument2;
  allLinks := htmlDoc.Links;
  for i := 0 to allLinks.length - 1 do begin
    firstLink := allLinks.Item(i,'') as IHTMLElement;
    url := firstLink.toString;
    lMeGusta := False ;
    for ii := 0 to Length( aLinksQueMeGustan )- 1 do
      if (leftStr(url, 
length(aLinksQueMeGustan[ii]))=aLinksQueMeGustan[ii]) then
        lMeGusta := True ;
    if lMeGusta then
      aLinks.Add( url );
    end;
  memo1.Lines.Assign(aLinks);
  memo1.Lines.SaveToFile('links.txt');
  lbLinks.Caption := IntToStr( aLinks.Count );
end;

btw... this could be usefull.. this works to post fields and get the 
result page
  try
    IdHTTP := TIdHTTP.Create(nil);
    Fields := TStringList.Create;
    Fields.Values['ID']             := 123;
    response := IdHTTP.Post('http://www.miweb.com/show.php', Fields );
  finally
    IdHTTP.Free;
    Fields.Free;
    end;

terhes i escribió:
>  
>
> Hello
> I have to retrive some data from a web page.
> In the web page a have o table with records. On every end of every 
> single recod a have a href link ( to a page that show that record in 
> detail mod). I want to know how to clik on every link in that page and 
> retrive some records ( this part I have some clues how I can be done) 
> go back and click to href on next record.
>
> Thanks
>
> 
>
>
> __________ Información de NOD32, revisión 4440 (20090919) __________
>
> Este mensaje ha sido analizado con NOD32 antivirus system
> http://www.nod32.com

Reply via email to