Selenium execute_script window.scrollTo not scrolling window Selenium execute_script window.scrollTo not scrolling window selenium selenium

Selenium execute_script window.scrollTo not scrolling window


Try using scrollIntoView of the element you want to scroll to, sorry this is in Java, but should work the same in python:

    driver.manage().window().maximize();    driver.get("http://www.businesswire.com/portal/site/home/");    wait = new WebDriverWait(driver, 10);    driver.findElement(By.id("bw-search-input")).clear();    driver.findElement(By.id("bw-search-input")).sendKeys("biotechnology");    driver.findElement(By.id("bw-search-input")).sendKeys(Keys.ENTER);    WebElement clicklink = driver.findElement(By.id("more-news-results"));    ((JavascriptExecutor) driver).executeScript("arguments[0].scrollIntoView(true);", clicklink);    clicklink.click();    Thread.sleep(1000);    WebElement clicknext = wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//*[@id=\"more-news-pagination\"]/div/div[1]/div/a")));    ((JavascriptExecutor) driver).executeScript("arguments[0].scrollIntoView(true);", clicknext);    clicknext.click();


StackOverFlow won't let me post any more comments? The url is in the code. But the homepage url is not the problem page. The problem page is the search page after the home page. The search page can only be gotten to through a search on the homepage. My code does all this.