How to set up rselenium for R?

Download latest version of RSelenium >= 1.7.1. Run the following: library(RSelenium) rD <- rsDriver() # runs a chrome browser, wait for necessary files to download remDr <- rD$client # no need for remDr$open() browser should already be open If you want a firefox browser use rsDriver(browser = “firefox”). This is detailed in http://rpubs.com/johndharrison/RSelenium-Basics appendix. The … Read more

Scrolling page in RSelenium

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 could scroll to the buttom like this: webElem <- remDr$findElement(“css”, “body”) webElem$sendKeysToElement(list(key = “end”)) And you could scroll to the top like this: webElem$sendKeysToElement(list(key = “home”)) And in case you want to scroll down just a bit, use … Read more

can’t execute rsDriver (connection refused)

Note: this answer is meant for Windows When trying to run the deprecated checkForServer() Selenium offers two options: use rsDriver use Docker see: RSelenium::checkForServer() # Error: checkForServer is now defunct. Users in future can find the function in # file.path(find.package(“RSelenium”), “examples/serverUtils”). The # recommended way to run a selenium server is via Docker. Alternatively # … Read more