Programmatically login to OKC
===

I'm trying to programatically login to OKCupid ([www.okcupid.com/login][1])in order to fetch scrape some user data.  I've tried to put together a python script to do this, but seem to be doing something wrong.

The behavior I'd like from this sample script is to login, follow a redirect to the homepage  then print the HTML response.  Here's what I have so far:

    import urllib, urllib2, cookielib
    
    # cookie storage
    cj = cookielib.CookieJar()
    opener = urllib2.build_opener(
        urllib2.HTTPCookieProcessor(cj),
        urllib2.HTTPRedirectHandler
        )
    # Useragent
    opener.addheaders.append(('User-agent','Mozilla/4.0'))
    
    url = 'http://www.okcupid.com/login'
    login_data = urllib.urlencode({
        'username':'notauser',
        'user_pass':'notapassword',
        })
    
    req = urllib2.Request(url,login_data)
    resp = urllib2.urlopen(req)
    the_page = resp.read()
    
    print the_page


  [1]: http://www.okcupid.com/login