我可以使用Selenium打开Google Apps菜单,但无法单击菜单项: google apps
//Clicks on google apps link
WebDriverWait wait = new WebDriverWait(driver, 10);
wait.until(ExpectedConditions.visibilityOfElementLocated(By.cssSelector("path")));
driver.findElement(By.cssSelector("path")).click();
//Click on menu Item
WebDriverWait wait = new WebDriverWait(driver, 10);
wait.until(ExpectedConditions.visibilityOfElementLocated(By.Link("Gmail")));
driver.findElement(By.cssSelector("Gmail")).click();
答案 0 :(得分:0)
您尝试过吗:
gmail_button = driver.find_element_by_xpath('xpath-of-google-button')
gmail_button.click()
我认为它可以工作。我认为,通过xpath查找元素是刮取网络的最精确工具。 :)