antoinerzad1
antoinerzad1

Reputation: 1

Selenium Python click a button

I can't find how to make my system click my button. here is the code of the button (or in attachment)

<button class="btn btn-primary btn-captcha" id="invisibleCaptchaShortlink" type="submit">continue</button>

enter image description here

I've already tried this command, but it doesn't work.

search = driver.find_element_by_name("invisibleCaptchaShortlink")
search.click()

Upvotes: 0

Views: 187

Answers (1)

SeleniumUser
SeleniumUser

Reputation: 4177

Use below xpath ::

driver.find_element_by_xpath("//button[@id='invisibleCaptchaShortlink'][contains(text(),'continue')]")

or

driver.find_element_by_id("invisibleCaptchaShortlink")

You are trying to search element with incorrect strategy use above xpath to locate your element find_element_by_name not valid instead of that you should use find_element_by_id

Upvotes: 2

Related Questions