python selenium ElementClickInterceptedException

MedusaSorcerer的博客


在使用 selenium.webdriver 的時候使用元素對象 .click() 方法是報錯:python

selenium.common.exceptions.ElementClickInterceptedException: xxxweb

可以使用如下方式進行替換點擊事件:spa

for i in driver.find_elements_by_class_name('className'):
    driver.execute_script("arguments[0].click();", i)
複製代碼

i 是須要點擊事件的元素對象。code

相關文章
相關標籤/搜索