Using the RSelenium
package, I'm trying to right click a link to download a file.
My application requires me to provide a log in with a password, which works fine, but this simple application demonstrates my current obstacle.
Consider this attempt to download an excel file of football rankings.
library(RSelenium)
RSelenium::checkForServer()
RSelenium::startServer()
remDr <- remoteDriver(browserName = "phantomjs")
remDr$open()
remDr$navigate("http://www.fantasypros.com/nfl/rankings/wr.php")
xls_link <- remDr$findElement("css selector",
"#export-xls")
Next I hover the mouse over the link I need to download
remDr$mouseMoveToLocation(webElement = xls_link)
When I take a screen shot it's apparent that the code has worked thus far (that is, the link is underlined)
Why doesn't the following:
remDr$click(1)
Download the file?