selenium模拟鼠标点击

JAVA环境

WebElement button = driver.findElement(By.xpath("/html/body/div[1]/div[3]/h2/div[2]"));
JavascriptExecutor js = (JavascriptExecutor) driver;
js.executeScript("arguments[0].click();", button);

 

python环境

button = self.driver.find_element_by_css_selector(
".ux-popover-buttons > button.ux-btn.ux-btn-primary.ux-btn-sm > span")

self.driver.execute_script("arguments[0].click();", button)



posted @ 2021-02-18 17:10  BookPen  阅读(267)  评论(0编辑  收藏  举报