<table cellspacing='0' cellpadding='0' border='0' ><tr><td style='font: inherit;'>I am trying to get the cookies from the site when I login, though html.info(). The problem is that when I check the source ( html.read() ) it shows that it does not recognize me as logged in. Also, if I chech html.info(), the cookies that I am suppose to receive, if I logged in successfully, are not there. What am I doing wrong?<br><br>import urllib<br>import urllib2<br><br>opener = urllib2.build_opener()<br>opener.addheaders = [('User-Agent', 'Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.8.1.12) Gecko/20080201 Firefox/2.0.0.12'),<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ('Referer', 'http://www.site.org/index.php')<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ]<br><br>values = urllib.urlencode({'user_name':
 'MyUsername', 'user_pass': 'MyPass^^', 'login' : 'Login'})<br>req = urllib2.Request('http://www.site.org/index.php', values)<br><br>html = opener.open(req)<br>print html.info()<br>print html.read()<br>html.close()<br><br></td></tr></table><br>
      <hr size=1>Looking for last minute shopping deals? <a href="http://us.rd.yahoo.com/evt=51734/*http://tools.search.yahoo.com/newsearch/category.php?category=shopping"> 
Find them fast with Yahoo! Search.</a>