samedi 20 avril 2019

How can I get a top element like a preceding of an element on xpath?

I need to get the father node of an element but specifying some attributes of then, not using indexes

My scenario is this

<div class="flockToUnlock section">
    <flock-to-unlock>
        <div class="xpto">

And my xpath is

//preceding::flock-to-unlock//div[@class'xpto']

I want to get the node <div class="flockToUnlock section"> but I'm getting the <div class='xpto'>




Aucun commentaire:

Enregistrer un commentaire