0

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">

2 Answers 2

1
driver.find_element_by_css_selector("input.gl-radio-input__input[value='Male']").click()
Sign up to request clarification or add additional context in comments.

1 Comment

Please don't post only code as answer, but also provide an explanation what your code does and how it solves the problem of the question. Answers with an explanation are usually more helpful and of better quality, and are more likely to attract upvotes.
0

I solved it with xpath.

You can copy of the span's xpath and click

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.