python+selenium button定位方法


报错内容:

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()


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM