I'm beginner and I have problem with nextXPath. The site use this html code for next page there is a div tag after "a" tag.
a href="?search_placeid=nE22HW2eAJQaf7o-&type=Events&page=2">div class="pagenumber prevnext">Next »div>/a>
It use the same class "pagenumber prevnext" for next and previous button. I don't know how I can set the nextXPath
the answer is: (//a[contains(@href,'page=')])[last()]/@href
I tried the following nextXPath but it didn't work. //a[div[contains(.,'Next') and @class="pagenumber prevnext"]]/@href
you can try this: //a[starts-with(., 'Next')]/@href
Log in to post a comment.
I'm beginner and I have problem with nextXPath. The site use this html code for next page there is a div tag after "a" tag.
a href="?search_placeid=nE22HW2eAJQaf7o-&type=Events&page=2">div class="pagenumber prevnext">Next »div>/a>
It use the same class "pagenumber prevnext" for next and previous button. I don't know how I can set the nextXPath
the answer is:
(//a[contains(@href,'page=')])[last()]/@href
I tried the following nextXPath but it didn't work.
//a[div[contains(.,'Next') and @class="pagenumber prevnext"]]/@href
you can try this:
//a[starts-with(., 'Next')]/@href