title: Use R Scipt to Login to Web site and perform some kind of action
body: <p>How can I use R to login to a web site and perform some action?  I think the code below is very close, but something seems to be off here.  </p>
  
  <pre><code>library(httr)
  library(XML)
  
  handle &lt;- handle("http://subscribers.footballguys.com") 
  path   &lt;- "amember/login.php"
  
  # fields found in the login form.
  login &lt;- list(
    amember_login = "username"
   ,amember_pass  = "password"
   ,amember_redirect_url = 
     "https://www.google.com/accounts/Login"
  )
  </code></pre>
  
  <h1>THEN</h1>
  
  <pre><code>response &lt;- POST(handle = handle, path = path, body = login)
  </code></pre>
  
  <p>Any insight into this would be most appreciated.</p>