请帮助... 我无法单击该元素。
HTML
展开后
My code
clcik_on_privkey = driver.find_element_by_class_name("radio")
Clcik_on_privkey = driver.find_element_by_name("331")
clcik_on_privkey = driver.find_element_by_xpath("//input[@name='331']")
clcik_on_privkey = driver.find_element_by_xpath("//label[10]")
clcik_on_privkey = driver.find_element_by_css_selector(".radio:nth-child(11)")
搜索该项目没有错误(有几种方法),但是如果在任何情况下在endin上添加“ .click()”,都会出错
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: unknown error: Element <label aria-flowto="aria8" class="radio">...</label> is not clickable at point (286, 562). Other element would receive the click: <div class="alert popup alert-info animated-show-hide" style="bottom: 0px; z-index: 999;">...</div>
(Session info: chrome=70.0.3538.77)
(Driver info: chromedriver=2.43.600210 (68dcf5eebde37173d4027fa8635e332711d2874a),platform=Windows NT 6.1.7600 x86_64)
答案 0 :(得分:0)
>>>0.0005
根据错误消息,上述元素正在获得点击。这意味着上面的html层位于您要单击的单选按钮上方。
如果在单击广播之前已将其关闭,则可能需要等待看不见的内容。您试图在警报弹出窗口消失之前单击。
<div class="alert popup alert-info animated-show-hide" style="bottom: 0px; z-index: 999;">
然后单击您的单选按钮,
WebDriverWait(driver, 60).until(
EC.invisibility_of_element_located((By.CSS_SELECTOR, 'div.alert.alert-info'))