Hallo,
dazu muß ein bisschen mehr Aufwand getrieben werden:
Delphi-Quellcode:
uses
ActiveX;
...
function GetBrowserHtml(
const webBrowser:TWebBrowser):
String;
var strStream :TStringStream;
adapter :IStream;
browserStream:IPersistStreamInit;
begin
strStream:=TStringStream.Create('
');
try
browserStream:=webBrowser.Document
as IPersistStreamInit;
adapter:=TStreamAdapter.Create(strStream, soReference);
browserStream.Save(adapter, True);
result:=strStream.DataString;
finally
strStream.Free();
end;
// try
end;
// GetBrowserHtml
...
...
var sl:TStringList;
...
sl:=TStringList.Create();
try
sl.Text:=GetBrowserHtml(WebBrowser1);
sl.SaveToFile('
C:\test.htm');
finally
sl.Free();
end;
// try
...