var
i,j,len:integer;
item1:OleVariant;
elec:IHTMLElementCollection;
doc:ihtmldocument2;
begin
for i := 0 to (WebBrowser1.OleObject.Document.frames.Length - 1) do
doc:= WebBrowser1.OleObject.Document.frames.item(i).document;
elec:=doc.all;
len:=elec.length;
memo1.Lines.Clear;
for j:=0 to len-1 do
begin
item:=elec.item(j,varempty);
//item is the elecment in the page
memo1.Lines.Add(item.tagname);//+' '+item.innertext);
end;
end;