Start a phantomjs binary in webdriver mode.
phantom(pjs_cmd = "", port = 4444L, extras = "", ...)
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 |
phantom
A utility function to control a phantomjs binary in webdriver mode.
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
phantom() returns a list with two functions:
returns the process id of the phantomjs binary running in webdriver mode.
terminates the phantomjs binary running in webdriver mode
using pskill
## 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)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.