You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

求助:Chrome环境下Selenium报Element is not clickable at point错误

解决Selenium中"Element is not clickable at point"错误

这个unknown error: Element is not clickable at point (1327, 310). Other element would receive the click错误在Web自动化测试里非常普遍,结合你使用的Chrome 65.0.3325.162、ChromeDriver 2.36和Selenium Standalone Server 3.11.0环境,我整理了几个针对性的解决方案:

1. 等待元素完全可点击后再操作

很多时候这个错误是因为元素还没完全加载完成,或者处于不可交互状态。用WebDriverWait配合element_to_be_clickable条件等待,能确保元素就绪后再执行点击:

Python示例:

from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By

# 等待10秒,直到元素可点击
wait = WebDriverWait(driver, 10)
target_element = wait.until(EC.element_to_be_clickable((By.CSS_SELECTOR, "your-element-selector")))
target_element.click()

Java示例:

import org.openqa.selenium.support.ui.WebDriverWait;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.By;

WebDriverWait wait = new WebDriverWait(driver, 10);
WebElement targetElement = wait.until(ExpectedConditions.elementToBeClickable(By.cssSelector("your-element-selector")));
targetElement.click();

2. 滚动到元素可见区域

如果元素不在当前浏览器视口内,Selenium的点击可能会被其他元素拦截。可以通过JS脚本将元素滚动到可见位置:

Python示例:

target_element = driver.find_element(By.CSS_SELECTOR, "your-element-selector")
# 滚动到元素居中位置
driver.execute_script("arguments[0].scrollIntoView({block: 'center'});", target_element)
target_element.click()

3. 处理遮挡元素

错误提示里明确提到"Other element would receive the click",说明有其他元素(比如Cookie弹窗、悬浮导航、加载遮罩)挡住了目标元素。先找到并关闭/隐藏这些遮挡元素,再点击目标:

比如先关闭Cookie提示:

# 假设关闭按钮的选择器是这个
close_cookie_btn = driver.find_element(By.ID, "close-cookie-banner")
close_cookie_btn.click()

# 再点击目标元素
target_element = driver.find_element(By.CSS_SELECTOR, "your-element-selector")
target_element.click()

4. 使用ActionChains模拟点击

如果直接调用click()方法无效,可以用动作链模拟鼠标移动到元素上再点击的操作:

Python示例:

from selenium.webdriver.common.action_chains import ActionChains

target_element = driver.find_element(By.CSS_SELECTOR, "your-element-selector")
ActionChains(driver).move_to_element(target_element).click().perform()

5. 确认版本兼容性

你当前的Chrome 65和ChromeDriver 2.36是匹配的(Chrome 64-66版本对应ChromeDriver 2.36),不过可以确认一下ChromeDriver是否完整安装,没有损坏。如果问题依旧,可以尝试重新下载对应版本的ChromeDriver替换。

6. 禁用Chrome扩展干扰

Chrome的自动化扩展有时候会影响元素交互,启动浏览器时可以添加禁用扩展的参数:

Python示例:

from selenium.webdriver.chrome.options import Options

chrome_options = Options()
chrome_options.add_argument("--disable-extensions")
driver = webdriver.Chrome(options=chrome_options)

内容的提问来源于stack exchange,提问作者sams rahman

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.20 11:53:40