Home > Net >  Using Selenium in Python to select a radio button
Using Selenium in Python to select a radio button

Time:01-19

I am trying to make a bot that automates booking a study room (Microsoft booking). When I try to select the radio button, it doesn't work. I tried using id and CSS_SELECTOR. I appreciate any help you can provide.

I want select room C, ID:service_2

room_c_select=driver.find_element(By.ID, "service_2")
room_c_select.click()

driver.find_element(By.CSS_SELECTOR,"input#service_2").click()

driver.find_element(By.CSS_SELECTOR,"[class='right serviceCard']input[type='radio'][id='service_2']")[0].click()

CodePudding user response:

You have to click on the small circle, i.e.

driver.find_elements(By.CSS_SELECTOR, 'span.image.icon-circleRegular')[1].click()
  • Related