title: Web-Scraping with Login and Redirect using R and rvest/httr
body: <p>I would like to scrape information from a webpage. There is a login screen, and when I am logged in, I can access all kinds off pages from which I would like to scrape information (such as the last name of a player, the object <code>.lastName</code>).
  I am using R and the packages <code>rvest</code> and <code>httr</code>.</p>
  
  <p>Somehow, the login seems to work, but I am clueless how to be redirected to the page I need to get the info from.</p>
  
  <p>The login form can be accessed on <code>http://kickbase.sky.de/anmelden</code> and the relevant pages have the form <code>http://kickbase.sky.de/spielerprofil/player-name/number</code>, e.g. <code>http://kickbase.sky.de/spielerprofil/nadiem-amiri/1639#</code>.</p>
  
  <p>Here is the code I used. Thank you very much for your help.</p>
  
  <pre><code>install.packages("rvest")
  install.packages("httr")
  library(rvest)
  library(httr)
  
  handle &lt;- handle("http://kickbase.sky.de")  # Create handle
  path   &lt;- "anmelden" #  Login Path
  
  # fields found in the login form.
  login &lt;- list(
    email = "testscrape@gmail.com"
    ,password  = "tester"
    ,redirect_url =  # I want to be redirected to this page and then scrape info from here
      "http://kickbase.sky.de/spielerprofil/nadiem-amiri/1639#"
  )
  
  response &lt;- POST(handle = handle, path = path, body = login)
  
  webpage &lt;- read_html(response)
  name_data &lt;- html_text(html_nodes(webpage, ".lastName"))
  name_data
  </code></pre>