Learn R Programming

RSelenium (version 1.7.7)

phantom: Start a phantomjs binary in webdriver mode.

Description

Defunct. Please use rsDriver or phantomjs

Usage

phantom(pjs_cmd = "", port = 4444L, extras = "", ...)

Value

phantom() returns a list with two functions:

getPID

returns the process id of the phantomjs binary running in webdriver mode.

stop

terminates the phantomjs binary running in webdriver mode using pskill

Arguments

pjs_cmd

The name, full or partial path of a phantomjs executable. This is optional only state if the executable is not in your path.

port

An integer giving the port on which phantomjs will listen. Defaults to 4444. format [[<IP>:]<PORT>]

extras

An optional character vector: see 'Details'.

...

Arguments to pass to system2

Detail

phantom() is used to start a phantomjs binary in webdriver mode. This can be used to drive a phantomjs binary on a machine without selenium server. Argument extras can be used to specify optional extra command line arguments see http://phantomjs.org/api/command-line.html

Details

phantom A utility function to control a phantomjs binary in webdriver mode.

Examples

Run this code
if (FALSE) {
pJS <- phantom()
# note we are running here without a selenium server phantomjs is
# listening on port 4444
# in webdriver mode
remDr <- remoteDriver(browserName = "phantomjs")
remDr$open()
remDr$navigate("http://www.google.com/ncr")
remDr$screenshot(display = TRUE)
webElem <- remDr$findElement("name", "q")
webElem$sendKeysToElement(list("HELLO WORLD"))
remDr$screenshot(display = TRUE)
remDr$close()
# note remDr$closeServer() is not called here. We stop the phantomjs
# binary using
pJS$stop()
}

Run the code above in your browser using DataLab