Here is my probleme: I have two tags.
<div class='twoLink'
<a class='link' <div> microsoft word </div></a>
<a class='link' <div> word </div></a>
</div>
My goal is to click on the tag containing only the word "word" and not "microsoft word".
so I did this :
element = 'word'
linkWord = WebDriverWait(driver, timeout=5).until(EC.element_to_be_clickable(
(By.XPATH,"//a[contains(@class, 'link')]/div[contains(text(), '"+ element +"')]")))
driver.execute_script("arguments[0].click();", linkWord )
But this method makes me click on the tag containing "word" and not equal to "word", so the tag I click is the first one and not the second one as I would have liked.
I would have to find a method to check an equality but I didn't find one.
What can I do about it please ?