在selenium中,有时候选择好了元素,但是进行click()操作的时候会出问题。
如下图,报错为unable to locate element:
此时,添加点击事件即可:
element = driver.find_element_by_xpath("表达式")
driver.execute_script("arguments[0].click();", element)
如下图:
参考:
https://www.cnblogs.com/xiaoguo-/p/12143912.html
网友评论