I have a webpage that keeps loading new items when scrolling down the page until every item is loaded.
I'm working with Selenium in Java, and need to scroll down to the bottom of the page in order to load everything.
I have tried several different options, like scrolling to an element of the bottom of the page:
WebElement copyrightAtEndOfPage = webDriver.findElement(By.xpath("//a[@href='/utils/copyright.html']"));
((JavascriptExecutor) webDriver).executeScript("arguments[0].scrollIntoView();", copyrightAtEndOfPage);
This only scrolls down once though, and then the webpage keeps loading.
I also tried this approach, which also only scrolls down once, because it only takes the browser height into consideration.
Any help is highly appreciated.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…