greenee
greenee

Reputation: 7

Need to find a way to click on the message button using selenium with python

<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

Answers (1)

Stack
Stack

Reputation: 4526

Try this :

//button[span="Message"] Thanks to Andersson

//button//span[contains(text(), 'Send a message to')]

Upvotes: 1

Related Questions