phantom: Start a phantomjs binary in webdriver mode.

Description Usage Arguments Details Detail Value Examples

Description

Defunct. Please use rsDriver or phantomjs

Usage

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

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

Details

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

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

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

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
## Not run: 
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()

## End(Not run)

JohanHJH/RSelenium documentation built on May 22, 2019, 5:36 p.m.