uses ShellApi, OleCtrls, ActiveX,MSHTML_TLB,SHDocVw;
其中MSHTML_TLB要自己导入
procedure TMainForm.getHtml;
var HTMLDocument: IHTMLDocument2;
PersistFile: IPersistFile;
begin
HTMLDocument := Web.Document as IHTMLDocument2;
while HTMLDocument.readyState <> 'complete' do
Application.ProcessMessages; {wait download complete}
PersistFile := HTMLDocument as IPersistFile;
PersistFile.Save(StringToOleStr(tmpPath+sTempHtmlFile), System.True);
end;