I tried the code in here Scrolling page in RSelenium but it's not working as the web site that I'm working on will load more content as you scroll down. For example
webElem <- remDr$findElement("css", "body")
webElem$sendKeysToElement(list(key = "end"))
webElem$screenshot(display = TRUE)
This is the screenshot of part of the website.
Then I repeat the process again.
webElem$sendKeysToElement(list(key = "end"))
webElem$screenshot(display = TRUE)
The result is still the same.
If unfortunately your code does not work for scrolling down, try using executeScript()
as below :-
remDr$executeScript("window.scrollTo(0,document.body.scrollHeight);")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With