I'm trying to press an element <a class="clean" href="url"> with python selenium on the condition that some elements have a certain value. Those elements are <div data-passendheid="Correct"> with value 'Correct', <path stroke-width="11"> with value '11' and span in <span class="js-tooltip"> that contains text 'Available'. I tried it with xpath: driver.find_elements(By.XPATH, "//*[@id='js-top']/div/div/a and [contains(.,'Available')]") But it doesn't work because the elements are from different parents and children. If you know how to do it with xpath or a have different solution please let me know.
I can't share the website because you need to login, instead see the corresponding page source:
<div class="box box--obj push-left js-flow-block" data-passendheid="Correct">
<div class="js-animate-fadein" style="">
<a class="clean" href="url">
<div class="box__properties group">
<div class="js-tooltip">
<div class="timer js-tooltip__trigger id="js-tooltip__trigger___79833">
<span>
<svg>
<path stroke-width="11" >
</path>
</svg>
</span>
</div>
</div>
<div class="box--obj__type ellipsis">
<span class="js-tooltip">
<span class="js-tooltip__trigger" id="js-tooltip__trigger___21209">Available</span>
</span>
</div>
</div>
</a>
</div>
</div>