Reputation: 49
Hello I am coding selenium bot. I have a problem. How can I select male gender in radio input in these code
<label class="gl-radio-input__option"><input type="radio" class="gl-radio-input__input" value="Male"><span class="gl-radio-input__label">Erkek</span></label>
<input type="radio" class="gl-radio-input__input" value="Male">
Upvotes: 0
Views: 91
Reputation: 546
driver.find_element_by_css_selector("input.gl-radio-input__input[value='Male']").click()
Upvotes: 1
Reputation: 49
I solved it with xpath.
You can copy of the span's xpath and click
Upvotes: 0