david david - 6 months ago 13
Python Question

How do I click this button using Selenium Webdriver?

<input class="ch4_btn ch4_btnOrange ch4_btnDropShadow ch4_btnPlaceOrder" value="PLACE ORDER" type="button">


How do I "click" this button using selenium webdriver (in Python).

I tried:

driver.find_element_by_id("ch4_reviewBtnTopRt").click()


and

driver.find_element_by_css_selector("ch4_reviewBtnTopRt").click()


and got the error:

NoSuchElementException: Message: Unable to locate element:

Answer

try this:

driver.find_element_by_css_selector("input.ch4_btnOrange").click()
Comments