<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:arial,helvetica,sans-serif;font-size:10pt">I would like to sign onto a web page, but am having a difficult time determine what parameters to pass in my sign in.&nbsp; For a simple test, I am trying to parse text on a "friends" status page on twitter.&nbsp; This is not via the API, but the web.<br><br><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;">import urllib2, urllib, cookielib</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;">opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj))</span><br><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;">cj = cookielib.LWPCookieJar()</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier
 New,courier,monaco,monospace,sans-serif;">opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj))</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;">urllib2.install_opener(opener)</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;">d={'authenticity_token':'8578471445acd12dec39b3353b71c88969f1505e', 'username_or_email':'user','password':'pswd123'}</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;">params = urllib.urlencode(d)</span><br><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span>opener.open('<a target="_blank" href="http://twitter.com/login">http://twitter.com/login</a>', params)</span></span><br
 style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;">if not 'id' in [cookie.name for cookie in cj]:</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;">&nbsp;&nbsp;&nbsp; raise ValueError, "Login failed"</span><br><br>#########&nbsp;&nbsp; result<br>Traceback (most recent call last):<br>&nbsp; File "&lt;pyshell#12&gt;", line 2, in &lt;module&gt;<br>&nbsp;&nbsp;&nbsp; raise ValueError, "Login failed"<br>ValueError: Login failed<br><br>How can I tell what the page is asking for, and if I am passing the correct parameters?<br></div><br>



      </body></html>