Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/python-3.x/17.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 3.x 无法在浏览器中单击radio元素(使用Python 3和Selenium)_Python 3.x_Selenium_Selenium Webdriver_Selenium Chromedriver - Fatal编程技术网

Python 3.x 无法在浏览器中单击radio元素(使用Python 3和Selenium)

Python 3.x 无法在浏览器中单击radio元素(使用Python 3和Selenium),python-3.x,selenium,selenium-webdriver,selenium-chromedriver,Python 3.x,Selenium,Selenium Webdriver,Selenium Chromedriver,我正在使用Python 3,并使用Selenium在浏览器中单击单选按钮。我能够找到要单击的无线电元素。但是,当我执行元素。单击()时,它会给我一个错误: Message: unknown error: Element <Description of Element> is not clickable at point (340, 190). Other element would receive the click: <Description of some other e

我正在使用Python 3,并使用Selenium在浏览器中单击单选按钮。我能够找到要单击的无线电元素。但是,当我执行
元素。单击()
时,它会给我一个错误:

Message: unknown error: Element <Description of Element> is not clickable at point (340, 190).

Other element would receive the click: <Description of some other element>.  

使用Actions类或Java脚本执行器来实现这一点

from selenium.webdriver.common.action_chains import ActionChains

Registered_Project_RadioButton = browser.find_element_by_id("Promoter")
ActionChains(browser).move_to_element(Registered_Project_RadioButton).click().perform()


谢谢昆都克。第一个选项不起作用,但第二个解决方案起作用。谢谢:)您需要关闭其他元素或等待它消失,例如加载。。。弹出窗口、浮动标题、对话框等。
Registered_Project_RadioButton = browser.find_element_by_id("Promoter")
Registered_Project_RadioButton.click()
from selenium.webdriver.common.action_chains import ActionChains

Registered_Project_RadioButton = browser.find_element_by_id("Promoter")
ActionChains(browser).move_to_element(Registered_Project_RadioButton).click().perform()
Registered_Project_RadioButton = browser.find_element_by_id("Promoter")
browser.execute_script("arguments[0].click();", Registered_Project_RadioButton)