WebBrowser,如何取得被打开网页的所有连接?(100分)

L

L.Ming

Unregistered / Unconfirmed
GUEST, unregistred user!
WebBrowser,如何取得被打开网页的所有连接?就是当前网页内所有相关的连接,包括文字与超连接。
 

风铃夜思雨

Unregistered / Unconfirmed
GUEST, unregistred user!
var
do
c: IHTMLDocument2;
all: IHTMLElementCollection;
len, i: integer;
item: OleVariant;
begin
ListBox1.clear;
do
c := WebBrowser1.Document as IHTMLDocument2;
all :=do
c.Get_links;
len := all.length;
for i := 0 to len - 1do
begin
item := all.item(i, varempty);
ListBox1.Items.Add(item.innertext + '----------' + item.href);
end;
end;
 

Similar threads

顶部