From: Bruce F. <Bru...@sa...> - 2004-09-01 12:35:25
|
And, of course, if you really wanted the HtmlAnchor objects rather than = the HtmlLink objects, then it is even easier: List anchorList =3D myPage.getAnchors(); Bruce -- Bruce Faulkner SAS Institute Inc. -----Original Message----- From: htm...@li... = [mailto:htm...@li...] On Behalf Of Bruce = Faulkner Sent: Wednesday, September 01, 2004 8:23 AM To: htm...@li... Subject: RE: [Htmlunit-user] Getting all the Anchor (HTMLLinks) on a = page? Something like the following code should give what you need: List linkList =3D = myPage.getDocumentElement().getHtmlElementsByTagName(HtmlLink.TAG_NAME); Where myPage is an instance of an HtmlPage. Bruce -- Bruce Faulkner SAS Institute Inc. -----Original Message----- From: htm...@li... = [mailto:htm...@li...] On Behalf Of Robert = Baccus Sent: Tuesday, August 31, 2004 8:13 PM To: htm...@li... Subject: [Htmlunit-user] Getting all the Anchor (HTMLLinks) on a page? I noticed that HTMLUnit has the HtmlPage.getFirstAnchorByText(String = text) method. But what I am trying to accomplish is to parse the whole = page and pull out all of the HTMLLinks and put them into a list. Can = this easily be done? Thanks. =3D=3D=3D=3D=3D Rob Baccus Email: rb...@go... =09 __________________________________ Do you Yahoo!? Read only the mail you want - Yahoo! Mail SpamGuard. = http://promotions.yahoo.com/new_mail=20 ------------------------------------------------------- This SF.Net email is sponsored by BEA Weblogic Workshop FREE Java Enterprise J2EE developer tools! Get your free copy of BEA WebLogic Workshop 8.1 today. = http://ads.osdn.com/?ad_id=3D5047&alloc_id=3D10808&op=3Dclick _______________________________________________ Htmlunit-user mailing list Htm...@li... https://lists.sourceforge.net/lists/listinfo/htmlunit-user ------------------------------------------------------- This SF.Net email is sponsored by BEA Weblogic Workshop FREE Java Enterprise J2EE developer tools! Get your free copy of BEA WebLogic Workshop 8.1 today. = http://ads.osdn.com/?ad_idP47&alloc_id=10808&op=3Dick _______________________________________________ Htmlunit-user mailing list Htm...@li... https://lists.sourceforge.net/lists/listinfo/htmlunit-user |