import urllib2 import urllib import re from cookielib import CookieJar, DefaultCookiePolicy cj = CookieJar() opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(self.cj)) r = opener.open("loginposturlsiniyazin",urllib.urlencode({'user_name':"username","password":"xxxx"})) print r.read()