Element is not click is not clickable at point (395, 553). Other element would receive the click

本文解析了Selenium WebDriver在操作元素时出现的WebDriverException错误,详细分析了元素被遮挡导致无法点击的问题,并提供了通过执行JavaScript来解决此问题的方法。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

selenium.common.exceptions.WebDriverException: Message: unknown error: Elementis not click is not clickable at point (395, 553). Other element would receive
the click
selenium点击某元素报错,实际该元素存在于页面

selenium.common.exceptions.WebDriverException: Message: unknown error: Element <iframe src="jptInputInvoiceQuery.do?ssId=JPT&amp;loginId=5B1C3F7EF590AE4CF0F114F7BE51356A80D363F4B5BCD9B18B7ADB6DEA1A17A2&amp;ssoUrl=C8FDE268A4E24C2CCC6E19C529EAA03C1B101B2A7EA3E849504B098F47E83780" id="JPT#JPT_M31_inputInvoiceQuery" style="" cd_frame_id_="47cf27d06fe06f664337f715f67f8e42"></iframe> is not clickable at point (395, 553). Other element would receive
the click: <div id="index-tabs" class="tab-hrs-orange" style="width: 1176px; display: block;">...</div>

如图所示,由于点击下载了文件,chrome自动弹出下载的弹框,将需要点击的“下一页”按钮遮住导致无法点击
遮盖前:
图1
遮盖后:
图2
原始代码:

driver.find_element_by_id('button-1044').click()

改进后代码:

element = driver.find_element_by_id('button-1044')
driver.execute_script('arguments[0].click();', element)
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值