title: Web scraping password protected website using R
body: <p>i would like to web scrape yammer data using R,but in order to do so first il have to login to this page,(which is authentication for an app that i created).</p>
  <p><a href="https://www.yammer.com/dialog/authenticate?client_id=iVGCK1tOhbZGS7zC8dPjg" rel="nofollow noreferrer">https://www.yammer.com/dialog/authenticate?client_id=iVGCK1tOhbZGS7zC8dPjg</a></p>
  <p>I am able to get the yammer data once i login to this page but all this is in browser by standard yammer urls
  (<a href="https://www.yammer.com/api/v1/messages/received.json" rel="nofollow noreferrer">https://www.yammer.com/api/v1/messages/received.json</a>)</p>
  <p>I have read through similar questions and tried the suggestions but still cant get through this issue.</p>
  <p>I have tried using httr,RSelenium,rvest+Selector gadget.</p>
  <p>End goal here is to do everything in R (getting data,cleaning,sentiment analysis...the cleaning and sentiment analysis part is done but as of now the getting data part is manual and i would like to automate that by handling it from R)</p>
  <p><em><strong>1.Trial using httr:</strong></em></p>
  <pre><code>usinghttr&lt;- GET(&quot;https://www.yammer.com/dialog/authenticate?client_id=iVGCK1tOhbZGS7zC8dPjg&quot;,
       authenticate(&quot;Username&quot;, &quot;Password&quot;))
  </code></pre>
  <p>corresponding Result : Response [https://www.yammer.com/dialog/authenticate?client_id=iVGCK1tOhbZGS7zC8dPjg]
  Date: 2015-04-27 12:25
  Status: 200
  Content-Type: text/html; charset=utf-8
  Size: 15.7 kB
  content of this page showed that it has opened the login page but didnt authenticate.</p>
  <p><em><strong>2.Trial using selector gadget + rvest</strong></em></p>
  <p>i tried scraping wikipedia using this method but couldnt apply it to yammer as authentication would be required prior to calling the html tag that selctor gadget gives.</p>
  <p><em><strong>3.Trial using RSelenium</strong></em></p>
  <p>tried this using the standard browsers and phantomjs but got some errors</p>
  <pre><code>&gt; startServer()
  </code></pre>
  <blockquote>
  <p>remDr &lt;- remoteDriver$new()</p>
  <p>remDr$open()
  [1] &quot;Connecting to remote server&quot;
  Undefined error in RCurl call.
  Error in queryRD(paste0(serverURL, &quot;/session&quot;), &quot;POST&quot;, qdata = toJSON(serverOpts)) :</p>
  </blockquote>
  <pre><code>&gt; pJS &lt;- phantom()
  </code></pre>
  <p>Error in phantom() : PhantomJS binary not located.</p>