Skip to content

Instantly share code, notes, and snippets.

@bedantaguru
Last active December 4, 2020 09:00
Show Gist options
  • Save bedantaguru/62086f608fd0f1b20029932345a63972 to your computer and use it in GitHub Desktop.
Save bedantaguru/62086f608fd0f1b20029932345a63972 to your computer and use it in GitHub Desktop.
Getting RSelenium work with Selenium 3 and Firefox
rm(list=ls())
options(stringsAsFactors = F)
library(RSelenium)
# One can make terminal invisible but initially it helps in detecting any potential problem
# Use proper path for Selenium and geckodriver.exe.
# remember to rename the donwloaded Selenium
sel <- startServer(dir = "C:/Dev/Selenium/",
javaargs = c("-Dwebdriver.gecko.driver=\"C:/Dev/Selenium/geko/geckodriver.exe\""),
invisible = F)
remDr <- remoteDriver(remoteServerAddr = "localhost",
port = 4444,
browserName = "firefox",
extraCapabilities = list(marionette = TRUE))
remDr$open()
# test
remDr$navigate("https://www.google.com/")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment