在这篇文章中,我们将带领您了解Python和Selenium-未知错误:在点的全貌,包括663,469元素不可单击。其他元素将获得点击:的相关情况。同时,我们还将为您介绍有关ElementClickI
在这篇文章中,我们将带领您了解Python和Selenium-未知错误:在点的全貌,包括663,469元素不可单击。其他元素将获得点击:的相关情况。同时,我们还将为您介绍有关ElementClickInterceptedException:消息:元素点击被拦截其他元素会收到点击:Selenium Python、ElementClickInterceptedException:消息:拦截了元素单击:Selenium和Python无法单击元素、ElementNotVisibleException:消息:尝试通过Selenium和Python单击按钮时,元素不可交互错误、Java-元素MyElement在点(x,y)不可点击...其他元素将获得点击的知识,以帮助您更好地理解这个主题。
本文目录一览:- Python和Selenium-未知错误:在点(663,469)元素不可单击。其他元素将获得点击:
- ElementClickInterceptedException:消息:元素点击被拦截其他元素会收到点击:Selenium Python
- ElementClickInterceptedException:消息:拦截了元素单击:Selenium和Python无法单击元素
- ElementNotVisibleException:消息:尝试通过Selenium和Python单击按钮时,元素不可交互错误
- Java-元素MyElement在点(x,y)不可点击...其他元素将获得点击
Python和Selenium-未知错误:在点(663,469)元素不可单击。其他元素将获得点击:
我有此selenium代码,应单击大小选择按钮。
submit_button = driver.find_element_by_class_name(''pro_sku'')elementList = submit_button.find_elements_by_tag_name("a")elementList[3].click()
它适用于其他页面,但现在在一页上出现此错误:
selenium.common.exceptions.WebDriverException: Message: unknown error: Element is not clickable at point (663, 469). Other element would receive the click:
我不明白,因为我可以查看Selenium打开的浏览器窗口,并且通常可以单击这些按钮。
我该如何解决?
有人问这个网站。它在这里:http : //de.sinobiologic.com/GM-CSF-
CSF2-Protein-g-19491.html
答案1
小编典典您可以使用action_chains模拟鼠标移动
actions = ActionChains(driver)actions.move_to_element(elementList[3]).perform()elementList[3].click()
编辑
该<a>
标签是不实际的尺寸。尝试
sizes = driver.find_elements_by_class_name(''size_defaut'')sizes[3].click()
ElementClickInterceptedException:消息:元素点击被拦截其他元素会收到点击:Selenium Python
如何解决ElementClickInterceptedException:消息:元素点击被拦截其他元素会收到点击:Selenium Python?
我已经看到有关此错误的其他问题,但我的情况是在我的程序中,另一个元素应该收到点击。详细说明:webdriver 正在滚动谷歌搜索,它必须点击它找到的每个网站,但程序阻止了它。我怎样才能让它不搜索它点击的上一个网站?
这就是功能。程序正在循环它,在第一个循环之后它向下滚动并出现错误:
def get_info():
browser.switch_to.window(browser.window_handles[2])
description = webdriverwait(browser,10).until(
EC.presence_of_element_located((By.TAG_NAME,"h3"))
).text
site = webdriverwait(browser,"cite"))
)
site.click()
url=browser.current_url
#removes the https:// and the / of the url
#to get just the domain of the website
try:
link=url.split("https://")
link1=link[1].split("/")
link2=link1[0]
link3=link2.split("www.")
real_link=link3[1]
except IndexError:
link=url.split("https://")
link1=link[1].split("/")
real_link=link1[0]
time.sleep(3)
screenshot=browser.save_screenshot("photos/"+"(" + real_link + ")" + ".png")
global content
content=[]
content.append(real_link)
content.append(description)
print(content)
browser.back()
time.sleep(5)
browser.execute_script("window.scrollBy(0,400)","")
time.sleep(5)
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)
ElementClickInterceptedException:消息:拦截了元素单击:Selenium和Python无法单击元素
我试图单击“所有主题”和“所有状态”复选框,然后搜索结果。当我运行脚本时,会打开一个Chrome窗口,大小为1036x674。
如果我不理会窗口,则会出现元素点击拦截错误。如果我最小化或最大化窗口,则脚本可以正常工作。
我正在使用Selenium 3.141.0,chrome 76,chromedriver 76和python 3.6
chromedriver_path = r"C:\Users\path\to\chromedriver.exe"
browser = webdriver.Chrome(executable_path=chromedriver_path)
url = "http://www.ncsl.org/research/transportation/autonomous-vehicles-legislative-database.aspx"
topics_xpath = "//*[@id=\"dnn_ctr81355_StateNetDB_UpdatePanel1\"]/div[1]/div[2]/span/label"
states_xpath = "//*[@id=\"dnn_ctr81355_StateNetDB_UpdatePanel1\"]/div[2]/div[2]/span/label"
browser.get(url)
time.sleep(30)
elem = browser.find_element_by_xpath(topics_xpath)
elem.click()
time.sleep(5)
elem = browser.find_element_by_xpath(states_xpath)
elem.click()
但是我得到这个错误:
ElementClickInterceptedException:消息:拦截了元素单击:
元素
将要单击的CheckBox在我要单击的复选框的正下方。
ElementNotVisibleException:消息:尝试通过Selenium和Python单击按钮时,元素不可交互错误
如何解决ElementNotVisibleException:消息:尝试通过Selenium和Python单击按钮时,元素不可交互错误?
与文本的元素 是一个动态的元素,以便找到你要引起元素 webdriverwait 的 元素是可点击 ,你既可以使用以下方法解决:
-
使用
CSS_SELECTOR
:webdriverwait(driver, 20).until(EC.element_to_be_clickable((By.CSS_SELECTOR, "div.action-bar button.c-button.c-button--blue"))).click()
-
使用
XPATH
:webdriverwait(driver, 20).until(EC.element_to_be_clickable((By.XPATH, "//div[contains(@class, ''action-bar'')]//button[@c-button c-button--blue'' and normalize-space()=''Close'']"))).click()
-
:您必须添加以下导入:
from selenium.webdriver.support.ui import webdriverwait
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
解决方法
我有一个包含源代码的页面,如下面的代码。在执行操作后,在其中显示“撤消”和“关闭”按钮。我试图单击“关闭”按钮。我已经尝试了下面的所有三个代码块,但都无法正常工作。有人可以指出我做错了什么,还是建议其他尝试?
html来源:
<div><div><i></i><div>Your stuff is going to <span>place</span> is on its way.</div><div><button> Undo</button></div><div><button> Close</button></div></div></div>
代码尝试:
#driver.find_element_by_id("gh69ID1m3_xtdTUQuwadU").click()
driver.find_element_by_css_selector(''.c-button.c-button--blue'').click()
#driver.find_element_by_link_text(''Close'').click()
错误:
---------------------------------------------------------------------------
ElementNotVisibleException Traceback (most recent call last)
<ipython-input-15-6d570be770d7> in <module>()
1 #driver.find_element_by_id("gh69ID1m3_xtdTUQuwadU").click()
----> 2 driver.find_element_by_css_selector(''.c-button.c-button--blue'').click()
3 #driver.find_element_by_link_text(''Close'').click()
~/anaconda/envs/py36/lib/python3.6/site-packages/selenium/webdriver/remote/webelement.py in click(self)
78 def click(self):
79 """Clicks the element."""
---> 80 self._execute(Command.CLICK_ELEMENT)
81
82 def submit(self):
~/anaconda/envs/py36/lib/python3.6/site-packages/selenium/webdriver/remote/webelement.py in _execute(self,command,params)
626 params = {}
627 params[''id''] = self._id
--> 628 return self._parent.execute(command,params)
629
630 def find_element(self,by=By.ID,value=None):
~/anaconda/envs/py36/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py in execute(self,driver_command,params)
318 response = self.command_executor.execute(driver_command,params)
319 if response:
--> 320 self.error_handler.check_response(response)
321 response[''value''] = self._unwrap_value(
322 response.get(''value'',None))
~/anaconda/envs/py36/lib/python3.6/site-packages/selenium/webdriver/remote/errorhandler.py in check_response(self,response)
240 alert_text = value[''alert''].get(''text'')
241 raise exception_class(message,screen,stacktrace,alert_text)
--> 242 raise exception_class(message,stacktrace)
243
244 def _value_or_default(self,obj,key,default):
ElementNotVisibleException: Message: element not interactable
(Session info: chrome=72.0.3626.109)
(Driver info: chromedriver=2.42.591059 (a3d9684d10d61aa0c45f6723b327283be1ebaad8),platform=Mac OS X 10.12.6 x86_64)
Java-元素MyElement在点(x,y)不可点击...其他元素将获得点击
我正在尝试使用基于selenium的Katalon Studio进行一些测试。在我的测试之一中,我必须在文本区域内编写。问题是我得到以下错误:
...Element MyElement is not clickable at point (x, y)... Other element would receive the click...
实际上,我的元素放置在其他可能隐藏它的diva里面,但是如何使click事件击中我的textarea?
答案1
小编典典Element ... is not clickable at point (x, y). Other element would receive the click"
可能是由不同因素引起的。你可以通过以下任一过程解决它们:
由于存在JavaScript或AJAX调用而无法单击元素
尝试使用Actions
Class:
WebElement element = driver.findElement(By.id("id1"));Actions actions = new Actions(driver);actions.moveToElement(element).click().build().perform();
- 由于元素不在视口中,因此无法单击
尝试用于JavascriptExecutor将元素带入视口中:
JavascriptExecutor jse1 = (JavascriptExecutor)driver;jse1.executeScript("scroll(250, 0)"); // if the element is on top.jse1.executeScript("scroll(0, 250)"); // if the element is at bottom.
要么
WebElement myelement = driver.findElement(By.id("id1"));JavascriptExecutor jse2 = (JavascriptExecutor)driver;jse2.executeScript("arguments[0].scrollIntoView()", myelement);
在元素可单击之前,页面正在刷新。
在这种情况下诱发一些wait
。元素存在于DOM中,但不可单击。
在这种情况下ExplicitWait
,请为元素添加一些可单击的元素。
WebDriverWait wait2 = new WebDriverWait(driver, 10);wait2.until(ExpectedConditions.elementToBeClickable(By.id("id1")));
- 元素存在但具有临时覆盖。
在这种情况下,ExplicitWait
使用ExpectedConditions
设置invisibilityOfElementLocated
为会使叠加层不可见。
WebDriverWait wait3 = new WebDriverWait(driver, 10);wait3.until(ExpectedConditions.invisibilityOfElementLocated(By.xpath("ele_to_inv")));
- 存在元素,但具有永久覆盖。
用于JavascriptExecutor直接在元素上发送点击。
WebElement ele = driver.findElement(By.xpath("element_xpath"));JavascriptExecutor executor = (JavascriptExecutor)driver;executor.executeScript("arguments[0].click();", ele);
关于Python和Selenium-未知错误:在点和663,469元素不可单击。其他元素将获得点击:的问题我们已经讲解完毕,感谢您的阅读,如果还想了解更多关于ElementClickInterceptedException:消息:元素点击被拦截其他元素会收到点击:Selenium Python、ElementClickInterceptedException:消息:拦截了元素单击:Selenium和Python无法单击元素、ElementNotVisibleException:消息:尝试通过Selenium和Python单击按钮时,元素不可交互错误、Java-元素MyElement在点(x,y)不可点击...其他元素将获得点击等相关内容,可以在本站寻找。
本文标签: