先导入 mshtml_tlb(Component->Import ActiveX->Microsoft HTML Object Libary)
use mshtml_tlb
首先 执行 webbrowser1.Navigate('http://www.adsad.net/asa.htm')
procedure TFrom1.WebBrowser1DocumentComplete(..)
var
doc:IHTMLDocument2;
all:IHTMLElementCollection;
len,i:integer;
item:OleVariant;
begin
if not webbrowser1.busy then
begin
doc:=webbrowser1.Document as IHTMLDocument2;
all:=doc.Get_Links;
len:=all.length;
for i:=0 to len-1 do
begin
item:=all.item(i,varempty);
Memo1.Lines.Add(item);
end;
end;
end;
结果全部在Memo1里面了!每一行一个链接~!
给分吧!^_^