title: Log in to website using Python Requests module
body: <p>I'm trying to use the requests module to log in to a website. I'm not sure what to reference in the html form to post the username and password. Here is the form I'm trying to use to post with to log in:</p>
  
  <pre><code>&lt;div class="login-box contents" id="login"&gt;
                          &lt;!--&lt;div class="login-instruction"&gt;
                              &lt;label class="fl-label"&gt; Enter your information below to login. &lt;/label&gt;
                          &lt;/div&gt;--&gt;
                          &lt;div class="login-username"&gt;
                              &lt;label for="username" class="fl-label"&gt;Username: &lt;/label&gt;
                              &lt;div class="clearboth"&gt;&lt;/div&gt;
  
  
                              &lt;input id="proxyUsername" name="proxyUsername" class="required" tabindex="1" maxLength="100" type="text" value="" onChange="remove_Error()" autocomplete="off"/&gt;
  
                          &lt;/div&gt;
                          &lt;div class="float-right"&gt;
                              &lt;b&gt;&lt;input type="checkbox" id="proxyRememberUser" name="proxyRememberUser" tabindex="-1" value="checked"&gt;&amp;nbsp;Remember Username&lt;/input&gt;&lt;/b&gt;
                          &lt;/div&gt;
                          &lt;br/&gt;
                          &lt;div class="login-password"&gt;
                              &lt;label for="password" class="fl-label"&gt;Password: &lt;/label&gt;
                              &lt;div class="clearboth"&gt;&lt;/div&gt;
  
                              &lt;input id="proxyPassword" name="proxyPassword" class="required" tabindex="2" maxLength="50" type="password" value="" onChange="remove_Error()" autocomplete="off" /&gt;
                          &lt;/div&gt;
  </code></pre>
  
  <p>I'm trying to figure out where/how in the form I tell it to put the username and password. So in the code below, the keys for the payload_login variable are not correct:</p>
  
  <pre><code>import requests
  
  
  username = raw_input('Please enter your username: ')
  password = raw_input('Please enter your password: ')
  
  payload_login = {
      'Username': username,
      'Password': password
  }
  
  with requests.Session() as s:
      con = s.post('somewebsite.com', \
         data=payload_login)
  </code></pre>