尝试在 python 中使用 selenium Webdriver 单击单选按钮时出现以下错误
ElementClickInterceptedException: Message: element click intercepted: Element
<input name="gender" required="" type="radio" id="gender-radio-1" class="custom-control-input" value="Male">
is not clickable at point (532, 370). Other element would receive the click: <label title="" for="gender-radio-1" class="custom-control-label">...</label>
(Session info: chrome=88.0.4324.182)
以下是我的代码 页网址:https ://demoqa.com/automation-practice-form
from selenium import webdriver
driver = webdriver.Chrome(executable_path = 'chromedriver')
driver.maximize_window()
driver.get('https://demoqa.com/automation-practice-form')
btn = driver.find_element_by_xpath('//input[@name = "gender"]')
driver.implicitly_wait(7)
btn.click()
有没有办法解决这个问题?我尝试了多种方法,但无法执行任务。