title: Login to a web site using python and submitting a code
body: <p>I have never written a web scraper or crawler, and needed to write a python code that allows me to login to a web site and then write a code and submit it. I tried using "requests" but couldn't figure it out.I wish someone could possibly help. Here's the html code parts, for the login:</p>
  
  <pre><code>&lt;form class="form-signin" action="login2.php" method="post"&gt;
      &lt;h2 class="form-signin-heading"&gt;sign in now&lt;/h2&gt;
      &lt;div class="login-wrap"&gt;
          &lt;div class="user-login-info"&gt;
              &lt;input type="text" class="form-control" name="pseudo" placeholder="Username" autofocus="" required=""&gt;
              &lt;input type="password" class="form-control" name="mdp" placeholder="Password" required=""&gt;
          &lt;/div&gt;
  
              &lt;span class="pull-right"&gt;
                  &lt;a class="" href="passoubli.php"&gt; Mot de passe oubli� ?&lt;/a&gt;
  
              &lt;/span&gt;
  
          &lt;button class="btn btn-lg btn-login btn-block" type="submit"&gt;Sign in&lt;/button&gt;
  </code></pre>
  
  <p>and here's the code form:</p>
  
  <pre><code>&lt;form name="sp" id="sp" method="post" action="verifi107.php"&gt;
                &lt;input type="text" class="form-control" placeholder="[ XXXXXXXX ]" maxlength="10" id="ext_frm_code2" name="RECALL" required=""&gt;
  
  
  
              &lt;center&gt;&lt;button class="btn btn-success btn-lg btn-block" type="submit" style="width:190px"&gt;Valider&lt;/button&gt;&lt;/center&gt;
         &lt;/form&gt;
  </code></pre>
  
  <p>Thank you.</p>