title: Scrape password-protected website in R
body: <p>I'm trying to scrape data from a password-protected website in R.  Reading around, it seems that the httr and RCurl packages are the best options for scraping with password authentication (I've also looked into the XML package).</p>
  
  <p>The website I'm trying to scrape is below (you need a free account in order to access the full page):
  <a href="http://subscribers.footballguys.com/myfbg/myviewprojections.php?projector=2" rel="noreferrer">http://subscribers.footballguys.com/myfbg/myviewprojections.php?projector=2</a></p>
  
  <p>Here are my two attempts (replacing "username" with my username and "password" with my password):</p>
  
  <pre><code>#This returns "Status: 200" without the data from the page:
  library(httr)
  GET("http://subscribers.footballguys.com/myfbg/myviewprojections.php?projector=2", authenticate("username", "password"))
  
  #This returns the non-password protected preview (i.e., not the full page):
  library(XML)
  library(RCurl)
  readHTMLTable(getURL("http://subscribers.footballguys.com/myfbg/myviewprojections.php?projector=2", userpwd = "username:password"))
  </code></pre>
  
  <p>I have looked at other relevant posts (links below), but can't figure out how to apply their answers to my case.</p>
  
  <p><a href="https://stackoverflow.com/questions/13204503/how-to-use-r-to-download-a-zipped-file-from-a-ssl-page-that-requires-cookies">How to use R to download a zipped file from a SSL page that requires cookies</a></p>
  
  <p><a href="https://stackoverflow.com/questions/10692066/how-to-webscrape-secured-pages-in-r-https-links-using-readhtmltable-from-xml">How to webscrape secured pages in R (https links) (using readHTMLTable from XML package)?</a></p>
  
  <p><a href="https://stackoverflow.com/questions/5420506/reading-information-from-a-password-protected-site">Reading information from a password protected site</a></p>
  
  <p><a href="https://stackoverflow.com/questions/24049701/r-rcurl-scrape-data-from-a-password-protected-site">R - RCurl scrape data from a password-protected site</a></p>
  
  <p><a href="http://www.inside-r.org/questions/how-scrape-data-password-protected-https-website-using-r-hold" rel="noreferrer">http://www.inside-r.org/questions/how-scrape-data-password-protected-https-website-using-r-hold</a></p>