unit Unit1;
interface
uses
Windows, Messages, SysUtils,MSHTML_TLB, Classes, Graphics, Controls, Forms, Dialogs,
OleCtrls, SHDocVw, StdCtrls, HTTPApp, XMLBrokr ,
ActiveX, ComCtrls;
……………………
procedure TForm1.Button3Click(Sender: TObject);
var
DoC: IHTMLDocument2;
begin
list:=TstringList.Create;
Doc := WebBrowser1.Document as IHTMLDocument2;
Memo1.Lines.Add(Doc.body.outerhtml); //读源码
Memo1.Lines.Add(Doc.body.outerText); //Html To Text
end;
需要引入:component/import active ../micsoft html object library(4.0).自己找对
我写个大概