title: R Selenium right click download file
body: <p>Using the <code>RSelenium</code> package, I'm trying to right click a link to download a file.</p>
  
  <p>My application requires me to provide a log in with a password, which works fine, but this simple application demonstrates my current obstacle.</p>
  
  <p>Consider this attempt to download an excel file of football rankings. </p>
  
  <pre><code>library(RSelenium)
  RSelenium::checkForServer()
  RSelenium::startServer()
  
  remDr &lt;- remoteDriver(browserName = "phantomjs")
  
  remDr$open()
  
  remDr$navigate("http://www.fantasypros.com/nfl/rankings/wr.php")
  
  
  xls_link &lt;- remDr$findElement("css selector", 
                                "#export-xls")
  </code></pre>
  
  <p>Next I hover the mouse over the link I need to download</p>
  
  <pre><code>remDr$mouseMoveToLocation(webElement = xls_link)
  </code></pre>
  
  <p>When I take a screen shot it's apparent that the code has worked thus far (that is, the link is underlined)</p>
  
  <p><a href="https://i.stack.imgur.com/YG3qV.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/YG3qV.png" alt="enter image description here"></a></p>
  
  <p>Why doesn't the following:</p>
  
  <pre><code>remDr$click(1)
  </code></pre>
  
  <p>Download the file?</p>