How to select a radio button with Selenium and Python
1 answer
There are several ways to find a radio input
, used here find_element_by_id()
:
radio = driver.find_element_by_id("ContentPlaceHolder1_HitterRadioButton")
radio.click()
Or, if you have problems with this approach, you can simulate the click through javascript:
radio = driver.find_element_by_id("ContentPlaceHolder1_HitterRadioButton")
driver.execute_script("arguments[0].click();", radio)
+5
source to share