function TFrmMain.GetSources1(FWB: TEmbeddedWB): String;
var
iall : IHTMLElement;
begin
if Assigned(FWB.Document) then
begin
iall := (FWB.Document AS IHTMLDocument2).body;
while iall.parentElement <> nil do
begin
iall := iall.parentElement;
end;
result := iall.outerHTML;
end;
end;
var
iall : IHTMLElement;
begin
if Assigned(FWB.Document) then
begin
iall := (FWB.Document AS IHTMLDocument2).body;
while iall.parentElement <> nil do
begin
iall := iall.parentElement;
end;
result := iall.outerHTML;
end;
end;
1 速度慢
2 mshtml有内存泄露 改用indy idhttp吧