title: Python Requests Post login
body: <p>Yes, I know I'm green. I'm trying to learn how to POST into websites though I cannot seem pic the right fields to pass into the POST request.</p>
  <p>Below you'll see the HTML for the site that I'm trying to grab everything from:</p>
  <p><a href="https://i.stack.imgur.com/KJiyq.png" rel="nofollow noreferrer">HTML picture</a></p>
  <p>I've tried the following code to log into the website for Greetly but been having a hell of a time. I'm sure the values I'm passing must have the wrong keys but I can't seem to figure out what it is that I'm doing wrong.</p>
  <pre><code>import requests
  from bs4 import BeautifulSoup
  
  url = 'https://app.greetly.com'
  urlVisitorLog = 'https://app.greetly.com/locations/00001/check_in_records'
  values = {
      'user[email]':'email',
      'user[password]':'password'
  }
  
  c = requests.Session()
  results = c.get(url)
  soup = BeautifulSoup(results.content, 'html.parser')
  key = soup.find(name=&quot;authenticity_token&quot;)
  authenticity_token = key['value']
  
  values[&quot;authenticity_token&quot;] = authenticity_token
  
  c.post(urlVisitorLog, headers= values)
  r = c.get(urlVisitorLog)
  soup2 = BeautifulSoup(r.content, 'html.parser')
  </code></pre>
  <p>Also once I get the username and password I noticed the authenticity token isn't bound to a specific id but I also kind of need that login in order to parse through and see where that is.</p>