设为首页收藏本站

安而遇随-随遇而安

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 622|回复: 0

[python] 遇到某个对象Click()不能正常使用?Element * is not clickable at po..

[复制链接]

 成长值: 31110

发表于 2020-11-6 15:24 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?立即注册

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

功能需求:
20201103173444126.png


源代码如下
  1. show_more = driver.find_element_by_xpath('//tbody[@class="ant-table-tbody"]/tr/td/a')
  2. 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标签被覆盖了!

解决办法:
  1. show_more = driver.find_element_by_xpath('//tbody[@class="ant-table-tbody"]/tr/td/a')

  2. ##方法1
  3. show_more.send_keys('\n')
  4. show_more.click()

  5. ##方法2
  6. show_more.send_keys(Keys.SPACE)
  7. show_more.click()

  8. # 方法3
  9. driver.execute_script("arguments[0].click();", show_more)
复制代码
推荐方法3







来自:https://www.pythonf.cn/read/157848

随遇而安
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

快速回复 返回顶部 返回列表