Scrolling a page in RSelenium

How can I manually scroll the bottom (or top) page using RSelenium WebDriver? I have an element that only becomes available when it is displayed on the page.

+6
source share
1 answer

Assuming you got

 library(RSelenium) startServer() remDr <- remoteDriver() remDr$open() remDr$setWindowSize(width = 800, height = 300) remDr$navigate("https://www.r-project.org/about.html") 

You can scroll to such as:

 webElem <- remDr$findElement("css", "body") webElem$sendKeysToElement(list(key = "end")) 

And you can scroll up as shown below:

 webElem$sendKeysToElement(list(key = "home")) 

And if you want to scroll down a bit, use

 webElem$sendKeysToElement(list(key = "down_arrow")) 

Key names are in selKeys .

+12
source

All Articles