[Delphi] Vyhladanie textu nasledne vypisanie

Programovacie jazyky, rady, poradňa...
ⓢⓐⓟⓛⓔⓡ
Star
Star
Používateľov profilový obrázok
Príspevky: 621
Registrovaný: 06 jún 2008, 15:07
Bydlisko: nedaleko od hojko.com

[Delphi] Vyhladanie textu nasledne vypisanie

Príspevok od používateľa ⓢⓐⓟⓛⓔⓡ »

Zdravým, potrebujem vyhladat v zdrojovom kode stranky text a nasledne ho vypisat ale ten text nieje stale rovnaky proste sa meni ale jedine su asi iba html tagy ktore su pred a za textom neviete prosim Vas ako sa to da spravit ?
thx :(
audiotrack
VIP
VIP
Používateľov profilový obrázok
Príspevky: 25958
Registrovaný: 09 sep 2005, 18:39
Kontaktovať používateľa:

Príspevok od používateľa audiotrack »

záleží aj od toho ako daný zdroják získavaš
ⓢⓐⓟⓛⓔⓡ
Star
Star
Používateľov profilový obrázok
Príspevky: 621
Registrovaný: 06 jún 2008, 15:07
Bydlisko: nedaleko od hojko.com

Príspevok od používateľa ⓢⓐⓟⓛⓔⓡ »

ziskam ho cez tuto funkciu

Kód: Vybrať všetko

Function GetHTML(AUrl: string): string;
var
  databuffer : array[0..4095] of char;
  ResStr : string;
  hSession, hfile, hRequest: hInternet;
  dwindex,dwcodelen,datalen,dwread,dwNumber: cardinal;
  dwcode : array[1..20] of char;
  res    : pchar;
  Str    : pchar;
begin
  ResStr:='';
  if pos('http://',lowercase(AUrl))=0 then
     AUrl:='http://'+AUrl;
  hSession:=InternetOpen('InetURL:/1.0',
                         INTERNET_OPEN_TYPE_PRECONFIG,
                         nil,
                         nil,
                         0);
  if assigned(hsession) then
  begin
    hfile:=InternetOpenUrl(
           hsession,
           pchar(AUrl),
           nil,
           0,
           INTERNET_FLAG_RELOAD,
           0);
    dwIndex  := 0;
    dwCodeLen := 10;
    HttpQueryInfo(hfile,
                  HTTP_QUERY_STATUS_CODE,
                  @dwcode,
                  dwcodeLen,
                  dwIndex);
    res := pchar(@dwcode);
    dwNumber := sizeof(databuffer)-1;
    if (res ='200') or (res ='302') then
    begin
      while (InternetReadfile(hfile,
                              @databuffer,
                              dwNumber,
                              DwRead)) do
      begin
        if dwRead =0 then
          break;
        databuffer[dwread]:=#0;
        Str := pchar(@databuffer);
        resStr := resStr + Str;
      end;
    end
    else
      ResStr := 'Status:'+res;
    if assigned(hfile) then
      InternetCloseHandle(hfile);
  end;
  InternetCloseHandle(hsession);
  Result := resStr;
end;
a vypisem ho do memo
Napísať odpoveď