Xpath - finding sibiling
I want to find the parent and the sibiling of some nodes in a website (it xpath). My big problem is that I want to find a sibiling of node, with no Id, only by it attribute.
for example: <a id="nav-europe-3231" class="" href="/EUROPE/" title="Europe News Headlines and Video from CNN.com International">Europe</a>
<a id="nav-asia-1265" class="" href="/ASIA/" title="Asia News Headlines and Video from CNN.com International">Asia</a>
I saw some instruction, like parent::child-node, but it doesn't find the xpath in this way.
How can I find the parents and the sibiling of this node?
In XPath 1 you can find the siblings and parent of the context node via the preceding-sibling:: and following-sibling:: axes (for siblings) and either ../ or theparent::` axe to find the parent.
Note that with axes you must specify a node name after the ::. If you don't know it, you can use the wildcard, *.