title: try to log into a simple course website using python
body: <p>I'm trying to use python to log into one of my course page.</p>
  
  <p>I use httpFox to detect the login page and the post data. I dont know why, but i keep getting error saying:</p>
  
  <blockquote>
    <p>   SE 3X03 / CS 4X03 error  </p>
    
    <p> SE 3X03 / CS 4X03 error - login.cpp</p>
    
    <p><p>Internal Error  3</p>  </p>
  </blockquote>
  
  <p>Here is my code:</p>
  
  <pre><code>import requests
  
  s = requests.session()
  
  login_data = {
      'sno':'xxxxxxx',
      'p1':'xxxxxxx',
      'login':'OK'
  }
  
  reqheader = {
  
      'Host'  :'www.cas.mcmaster.ca',
      'User-Agent' :  'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:34.0) Gecko/20100101 Firefox/34.0',
      'Accept'  : 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
      'Accept-Language' : 'en-US,en;q=0.5',
      'Accept-Encoding'  :    'gzip, deflate',
      'Referer'   :   'http://www.cas.mcmaster.ca/~franek/courses/se3x03_cs4x03/login/startlogin.cgi',
      'Connection' : 'keep-alive',
      'Content-Type'  :  'application/x-www-form-urlencoded',
      'Content-Length'    :  '33'
  }
  
  
  myurl = 'http://www.cas.mcmaster.ca/~franek/courses/se3x03_cs4x03/login/login.cgi'
  
  r = s.post(myurl, data = login_data, headers = reqheader)
  
  
  
  print r.text
  </code></pre>
  
  <p>Can anyone pls give me a hint about where i did wrong? i appreciate it. </p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>In the page source code there's a line:</p>
  
  <pre><code>&lt;form name="passwd" action="http://www.cas.mcmaster.ca/~franek/courses/se3x03_cs4x03/login/login.cgi"
  method="post"&gt;
  </code></pre>
  
  <p>Which is what httpFox has detected for me, and i think this is the actual log in link. But when i try to reach that url in my browser i get sth like this:</p>
  
  <blockquote>
    <p>SE 3X03 / CS 4X03 error - login.cpp</p>
    
    <p>Internal Error 11</p>
  </blockquote>
  
  <p>Could this be the reason why my code didnt work?</p>