马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
x
Element is not clickable at point,Other element would receive the click: xxx 遇到某个对象Click()不能正常使用?单击爬虫点击错误,事件被覆盖,完美解决!
环境:
python3.6 + selenium 3.11 + chromedriver.exe
错误简述:
Element * is not clickable at point,Other element would receive the click
源代码如下 - show_more = driver.find_element_by_xpath('//tbody[@class="ant-table-tbody"]/tr/td/a')
- show_more.click()
复制代码
报错信息: selenium.common.exceptions.WebDriverException: Message: unknown error:
Element * is not clickable at point (817, 751).
Other element would receive the click: *
错误解释:
a标签被点击时,被上一层td标签接收了点击,说明a标签被覆盖了!
解决办法: - show_more = driver.find_element_by_xpath('//tbody[@class="ant-table-tbody"]/tr/td/a')
- ##方法1
- show_more.send_keys('\n')
- show_more.click()
- ##方法2
- show_more.send_keys(Keys.SPACE)
- show_more.click()
- # 方法3
- driver.execute_script("arguments[0].click();", show_more)
复制代码推荐方法3
来自:https://www.pythonf.cn/read/157848
|