makaleler / Diğer Konular / Delphi Dinamik TWebBrowser ve SSL Sayfa

Delphi Dinamik TWebBrowser ve SSL Sayfa

17.10.2014 17:37:26

Delphi Dinamik TWebBrowser üzerinden SSL Sayfanın html içeriği

Bu fonksiyon web üzerinde ssl sayfa içeriğinin alınması için hazırlanmıştır.

Uses SHDocVw, msHtml, IdURI
function GetUrlContent(sUrl: string): string;

function GetHTML(w: TWebBrowser): String;
Var
e: IHTMLElement;
begin
Result := '';
if Assigned(w.Document) then
begin
e := (w.Document as IHTMLDocument2).body;

while e.parentElement <> nil do
begin
e := e.parentElement;
end;

Result := e.outerHTML;
end;
end;
var
http : TWebBrowser;
document: IHTMLDocument2;
begin
http := TWebBrowser.Create(frmMain);
try
http.Visible := False;
http.Navigate(TIdURI.URLEncode(sUrl));

//TWinControl(http).Name := 'http';
TWinControl(http).Parent := frmMain;
while http.Busy do Application.ProcessMessages;
// Javascript çalışmasın Silent
http.Silent := true;
Result := GetHTML(http);
finally
http.Free;
end;
end;

yazar husonet

Yorumlar

Bu içerik için sizde yorum yapabilirsiniz!
anasayfa | makaleler | haberler | dosyalar | linkler | hakkımızda