I have the following DOM
<a class="js-sku-link sku-link" title="Inno 3D GeForce RTX 3080 10GB GDDR6X X3 LHR Κάρτα Γραφικών PCI-E x16 4.0 με HDMI και 3 DisplayPort" data-e2e-testid="sku-price-link" href="/s/35993359/Inno-3D-GeForce-RTX-3080-10GB-GDDR6X-X3-LHR-%CE%9A%CE%AC%CF%81%CF%84%CE%B1-%CE%93%CF%81%CE%B1%CF%86%CE%B9%CE%BA%CF%8E%CE%BD-PCI-E-x16-4-0-%CE%BC%CE%B5-HDMI-%CE%BA%CE%B1%CE%B9-3-DisplayPort-N30803-106X-1810VA44H.html">
<span>από</span>
871,28 €
</a>
As you can see it has a class and a title. There are other elements in the page that have the same a class (js-sku-link sku-link
) but I want to be able to define based on the title which one I want. In this case I want the one that it has in title the text RTX 3080
. I tried the following without any luck
driver.find_element_by_xpath('//div[@data-e2e-testid="sku-price-link" and text()="RTX 3080"]').text
driver.find_element_by_xpath("//a[@title='6950']")