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