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 activeX control ../microsoft html object library(version4.0).
再uses里 MSHTML_TLB
试试看吧
/bbs/UploadFile/2005-3/2005320191459674.gif" border="0" onload="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" onmouseover="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor='hand'; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" onclick="if(!this.resized) {return true;} else {window.open('http://www./bbs/UploadFile/2005-3/2005320191459674.gif');}" onmousewheel="return imgzoom(this);" alt="" />