Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8525221
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T07:54:51+00:00 2026-06-11T07:54:51+00:00

I am interested in using selenium with R. I note that the various documentation

  • 0

I am interested in using selenium with R. I note that the various documentation is described here WebDriver (Selenium 2) API documentation. Has there been any work done on an implementation with R. How would I go about approaching this. In the documentation it notes about running a selenium server and one can query the api using Javascript. Any help would be much appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T07:54:53+00:00Added an answer on June 11, 2026 at 7:54 am

    Selenium can be accessed using the JsonWireProtocol.

    Firstly start up a Selenium server from the command line via:

    java -jar selenium-server-standalone-2.25.0.jar
    

    a new Firefox browser can be opened as follows:

    library(RCurl)
    library(RJSONIO)
    library(XML)
    
    baseURL<-"http://localhost:4444/wd/hub/"
    server<-list(desiredCapabilities=list(browserName='firefox',javascriptEnabled=TRUE))
    
    getURL(paste0(baseURL,"session"),
           customrequest="POST",
           httpheader=c('Content-Type'='application/json;charset=UTF-8'),
           postfields=toJSON(server))
    
    serverDetails<-fromJSON(rawToChar(getURLContent('http://localhost:4444/wd/hub/sessions',binary=TRUE)))
    serverId<-serverDetails$value[[1]]$id
    

    Navigate to google.

    getURL(paste0(baseURL,"session/",serverId,"/url"),
           customrequest="POST",
           httpheader=c('Content-Type'='application/json;charset=UTF-8'),
           postfields=toJSON(list(url="http://www.google.com")))
    

    get the id of the search box

    elementDetails<-fromJSON(rawToChar(getURLContent(paste0(baseURL,"session/",serverId,"/element"),
           customrequest="POST",
           httpheader=c('Content-Type'='application/json;charset=UTF-8'),
           postfields=toJSON(list(using="xpath",value="//*[@id=\"gbqfq\"]")),binary=TRUE))
           )
    
    elementId<-elementDetails$value
    

    search for a subject matter

    rawToChar(getURLContent(paste0(baseURL,"session/",serverId,"/element/",elementId,"/value"),
           customrequest="POST",
           httpheader=c('Content-Type'='application/json;charset=UTF-8'),
           postfields=toJSON(list(value=list("\uE009","a","\uE009",'\b','Selenium api in R')))
           ,binary=TRUE))
    

    return the search html

    googData<-fromJSON(rawToChar(getURLContent(paste0(baseURL,"session/",serverId,"/source"),
           customrequest="GET",
           httpheader=c('Content-Type'='application/json;charset=UTF-8'),
           binary=TRUE
           ))
           )
    

    get the suggested links

    gxml<-htmlParse(googData$value)
    urls<-unname(xpathSApply(gxml,"//*[@class='l']/@href"))
    

    close the session

    getURL(paste0(baseURL,"session/",serverId),
           customrequest="DELETE",
           httpheader=c('Content-Type'='application/json;charset=UTF-8')
           )
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am interested in using a DataObject and have been looking through the documentation.
I’m interested in using libhid to access a custom HID device that we are
I'm interested in using fcbkcomplete , which has: onselect – fire event on item
I've been doing a lot of reading up on RemoteWebDriver for Selenium 2 using
I am using Selenium 2 Java API with FirefoxDriver. When I fill a form,
I am interested in using Firemonkey for producing an iOS app. There are several
I'm interested in using Subsonic 3.0 for developing a new ASP.Net MVC application that
I'm interested in using Eclipse. The Eclipse Downloads page has versions for Java Developers
I'm interested in using Android for a E-Ink based platform. I know it has
I'm using WebDriver and selenium-firefox-driver version 2.3.1. Now when option.setSelected(); deprecated, one must do

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.