Xpath to get the 2nd url with the matching text in the href tag

Posted by Blankman on Stack Overflow See other posts from Stack Overflow or by Blankman
Published on 2010-04-12T00:31:20Z Indexed on 2010/04/12 0:43 UTC
Read the original article Hit count: 386

Filed under:
|
|

A html page has paging links, 1 set at the top of the page and another on the bottom of the page.

Using HtmlUnit, I am currently getting the HtmlAnchor on the page using getByAnchorText("1");

There is a problem in some of the links on the top, so I want to reference the bottom links using XPath.

nextPageAnchor = (HtmlAnchor) page.getByXPath("");

How can I reference the 2nd link on the page, with using xpath?

I need to reference the link using the AnchorText, so a link like:

<a href="....">33</a>

The href has random text, and is a javascript function so I have no idea what it will be.

Is this possible with xpath?

© Stack Overflow or respective owner

Related posts about java

Related posts about htmlunit