Folks, this is driving me crazy. I have snippets like the following
<label class="" for="M37_Q_POSWECHSEL_BETT_B1">
<input id="M37_Q_POSWECHSEL_BETT_B1" name="M37_Q_POSWECHSEL_BETT" value="B1" aria-describedby="M37_Q_POSWECHSEL_BETT_error_0" aria-invalid="true" data-clipboard="M37_Q_POSWECHSEL_BETT#B1" type="radio">
0
</label>
Here, I'd like to select the radio buttons and select them with the following code:
radios = driver.find_elements_by_xpath("//input[starts-with(@id, 'M37_Q_')][@value='B1']")
for radio in radios:
# just check the id
print(radio.get_attribute('id'))
radio.click()
It correctly selects the elements in question. However, it does not get selected nor does it yield any obvious errors. Can we use .click()
to select radio buttons here? Is this some kind of handler problem?