//方法 1 List<WebElement> btnList = driver.findElements(By.cssSelector("div.zwss-item-job-title")); WebElement btn = btnList.get(0); //((JavascriptExecutor) driver).executeScript("arguments[0].scrollIntoView(true);", btn); //方法2 //WebElement element = driver.findElement(By.id("my-id")); Actions actions = new Actions(driver); actions.moveToElement(btn); actions.perform(); //py 移动 页面 滚动窗口。 from selenium.webdriver.common.action_chains import ActionChains ActionChains(driver).move_to_element(driver.sl.find_element_by_id('my-id')).perform()
站长微信:xiaomao0055
站长QQ:14496453