Reputation: 7
<button aria-label="Send message to Francesca Felder" class="message-anywhere-button mn-person-card__person-btn-ext button-secondary-medium link-without-visited-state" data-ember-action="" data-ember-action-1634="1634">
<span aria-hidden="true">Message</span>
<span class="visually-hidden">
Send a message to Francesca Felder
</span>
Above is the button class I am trying to click using Selenium Webdriver.
I have tried doing this:
clickit = wait(browser, 10).until(EC.element_to_be_clickable((By.XPATH, "//button[span='Send a message to']")))
clickit.click()
It doesn't work at all.
Upvotes: 0
Views: 262
Reputation: 4526
Try this :
//button[span="Message"]
Thanks to Andersson
//button//span[contains(text(), 'Send a message to')]
Upvotes: 1