begin
HtmlDoc := WB.document as IHtmldocument2;
// AllLinks := HtmlDoc.get_links;
AllLinks := HtmlDoc.links;
Len := AllLinks.length ;
Links.BeginUpdate;
Innertext.BeginUpdate;
For I :=0 To Len-1 do
begin
//HtmlItem2 := AllLinks.item(I,emptyparam);
HtmlItem := AllLinks.item(I,emptyparam) as IHtmlElement;
//StringList.Add(Htmlitem2.href); //this is also a way to get the link
{if trim(HtmlItem.innerHtml)<>'' then
begin
Links.Add(trim(HtmlItem.ToString));
InnerText.Add(trim(HtmlItem.innerHtml));
end;
}
if trim(HtmlItem.innerText)<>'' then
begin
Links.Add(trim(HtmlItem.ToString));
InnerText.Add(trim(HtmlItem.Innertext));
end;
end;
Links.EndUpdate;
InnerText.EndUpdate;
end;