From: Robert B. <rba...@ya...> - 2004-09-01 14:28:25
|
Actually looking at the code below only returns the Anchor objects not the HtmlAnchor objects. I already looked at this and it didn't work for me. I am not sure that the HtmlLink object is what I am looking for either since I am trying to get the following <href a="somelink">some link name</a> in an object. I want to capture the Somelink and SomeLinkName fields and put them in a list. Thanks. --- Bruce Faulkner <Bru...@sa...> wrote: > And, of course, if you really wanted the HtmlAnchor objects rather than the HtmlLink objects, > then it is even easier: > > List anchorList = 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 = 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. > > ===== > Rob Baccus > Email: rb...@go... > > > > __________________________________ > Do you Yahoo!? > Read only the mail you want - Yahoo! Mail SpamGuard. http://promotions.yahoo.com/new_mail > > > ------------------------------------------------------- > 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=5047&alloc_id=10808&op=click > _______________________________________________ > 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_id808&op=ick > _______________________________________________ > 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_id808&op=click > _______________________________________________ > Htmlunit-user mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlunit-user > ===== Rob Baccus Email: rb...@go... _______________________________ Do you Yahoo!? Express yourself with Y! Messenger! Free. Download now. http://messenger.yahoo.com |