Mega Code Archive

 
Categories / Delphi / LAN Web TCP
 

How to save a html page from the twebbrowser component to your hard drive

//here is a simple way to copy an html page from the TWebBrowser to your hard //drive procedure TForm1.Button1Click(Sender: TObject); var Flags: OLEVariant; begin Flags := 0; //gets page from www.borland.com WebBrowser1.Navigate(WideString('http://www.borland.com'), Flags, Flags, Flags, flags); while WebBrowser1.busy do //wait until browser has finished downloading application.ProcessMessages; //save to memo field memo1.text:=WebBrowser1.OleObject.Document.Body.innerHTML; //from memo field save to file memo1.Lines.savetofile('c:\default.htm'); end;