Pythontr

husonet | Tarih: 17.10.2014

Delphi Dinamik TWebBrowser ve SSL Sayfa

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

[code Delphi]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;[/code]