Re: [Htmlparser-user] iterate through node list
Brought to you by:
derrickoswald
From: Derrick O. <der...@ro...> - 2007-09-17 11:48:00
|
=0AThe NodeList class has elementAt() and size() methods.=0Afor (int i =3D = 0; i < list.size(); i++)=0A node =3D list.elementAt(i);=0A=0AYou'll need t= o cast them to LinkTag nodes and then use getLink().=0A=0A----- Original Me= ssage ----=0AFrom: Nic Soltani <oo...@gm...>=0ATo: htmlparser-user@li= sts.sourceforge.net=0ASent: Sunday, September 16, 2007 11:56:25 PM=0ASubjec= t: [Htmlparser-user] iterate through node list=0A=0AHi=0AI created a NodeLi= st which contains hyperlinks extracted from an HTML webpage,=0AI need to be= able to iterate through every single node and extract its href.=0AWonderin= g if anyone can help me with:=0Ahow to Iterate nodes 1 by 1=0Aextract href= =0ANodeList URLs =3D ExtractHyperLinks(HTML);=0A/*=0A * at this stage we ha= ve all:=0A * <A HREF=3D"link1">something1</A>=0A * <A HREF=3D"link2= ">something2</A>=0A=0A * <A HREF=3D"link3">something3</A>=0A * <A H= REF=3D"link4">something4</A>=0A * <A HREF=3D"link5">something5</A>=0A *= /=0A=0A=0A=0A=0A=0A=0A |