baranuyukus
baranuyukus

Reputation: 49

Python Selenium Select Input

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

Answers (2)

driver.find_element_by_css_selector("input.gl-radio-input__input[value='Male']").click()

Upvotes: 1

baranuyukus
baranuyukus

Reputation: 49

I solved it with xpath.

You can copy of the span's xpath and click

Upvotes: 0

Related Questions