1

I get a blank page when trying to navigate to any page, and I can't find any DOM element. I've tried with 2 different machines I already had, both of them Ubuntu 14.04 Server.

library("RSelenium")
pJS <- phantom()
nav <- remoteDriver(remoteServerAddr = "localhost", port = 4444, browserName = "phantomjs")

nav$open()
nav$navigate("https://airenetworks.es/")
geco <- nav$findElement(using = "partial link text", value = "Oficina Virtual")
geco$clickElement()

The error in the last line of this code is:

Error:   Summary: NoSuchElement
     Detail: An element could not be located on the page using the given search parameters.
     class: SessionReqHand

Installed RSelenium via install.packages("RSelenium") and PhantomJS via apt-get install phantomjs. The demo("PhantomJSUserAgent") also fails.

If in this state I perform a nav$screenshot(display = TRUE) the image I get is all white. If you need the image data there it is:

iVBORw0KGgoAAAANSUhEUgAAAZAAAAEsCAYAAADtt+XCAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEwAACxMBAJqcGAAAAehJREFUeJztwTEBAAAAwqD1T20ND6AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB4N1SVAAH5HdPnAAAAAElFTkSuQmCC

If you need more info, please ask. Thank you!

Geiser
  • 1,054
  • 1
  • 12
  • 28
  • 1
    This has something to do with POODLE ([A](http://stackoverflow.com/a/26417660/1816580)), you need to use either a newer PhantomJS version > 1.9.7 or find a way to pass `--ssl-protocol=any` to PhantomJS. – Artjom B. Dec 11 '15 at 14:29
  • That's great! All of the URL's I tried were https. Trying with a non-ssl webpage works. Let's try what you've told me – Geiser Dec 11 '15 at 14:34
  • Installed this one from launchpad https://launchpad.net/~forger/+archive/ubuntu/phantomjs-nightly/+build/5835075 but still the error persists, and also `phantom(extras = "--ssl-protocol=any")` but the error persists too – Geiser Dec 11 '15 at 15:10

1 Answers1

2

I finally found that I had to code it as this it:

pJS <- phantom(extras = "--ignore-ssl-errors=true --ssl-protocol=tlsv1")
Sys.sleep(2)
nav <- remoteDriver(remoteServerAddr = "localhost", port = 4444, browserName = "phantomjs")

You have to set the protocol to tlsv1. Also important is to let it sleep for a second or two, because it takes time for it to start (After some trials and errors I realized that I needed the Sys.sleep(2) before calling the remoteDriver function)

Geiser
  • 1,054
  • 1
  • 12
  • 28