How to get the preceding element?

You can use this xpath:

//a[.="Next."]/preceding::a[1]

If I were to diagram it out, using an X to represent the current location, it would look like this:

------------------+------+------------------
preceding-sibling | self | following-sibling
------------------|------|------------------
last() ...  2   1 |  X   | 1   2  ... last()
------------------+------+------------------

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)