uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls,mshtml,Buttons,Activex, Psock, NMHttp,olectrls, ComCtrls,
SHDocVw;
var
doc:IHTMLDocument2;
all:IHTMLElementCollection;
len,i:integer;
item:OleVariant;
begin
doc:=WebBrowser1 .Document as IHTMLDocument2;
all:=doc.Get_links;//doc.Links亦可
len:=all.length;
for i:=0 to len-1 do begin
item:=all.item(i,varempty);//EmpryParam亦可
memo1.lines.add(item.href);
end;
end;