python+selenium button定位方法

时间:2020-01-06 18:10:07   收藏:0   阅读:608

报错内容:

selenium.common.exceptions.ElementClickInterceptedException

元素:

技术分享图片

 

 

解决方法2种:

1、

tijiao=driver.find_element_by_xpath("html/body/div[12]/div[2]/div[1]/div[1]/div[3]/div[1]/button[2]/span")
driver.execute_script("arguments[0].click();",tijiao)

 

2、本元素采用第2种方法

btn[0]   : 元素

from selenium import webdriver

webdriver.ActionChains(self.browser).move_to_element(btns[0]).click(btns[0]).perform()

原文:https://www.cnblogs.com/ljf520hj/p/12157396.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!