Re: how to browse using urllib2 and cookeilib the correct way

2006-04-26 Thread John J. Lee
Edward Elliott <[EMAIL PROTECTED]> writes: > [EMAIL PROTECTED] wrote: > > can anybody explain, in the first case why i need to do two attempts. > > I would guess it's because redhat requires your browser to submit a session > cookie with the login form. In the urllib2 example, the first request

Re: how to browse using urllib2 and cookeilib the correct way

2006-04-26 Thread John J. Lee
[EMAIL PROTECTED] writes: [...] > 1) >>>import urllib2,urllib,cookielib > 2) >>>cj = cookielib.CookieJar() > 3) >>>opener = urllib2.build_opener( urllib2.HTTPCookieProcessor(cj)) > 4) >>>data = urllib.urlencode ( { "username" : "user" , >"password" :"" } ) > 5) >>>fp = opener.open( > "h

Re: how to browse using urllib2 and cookeilib the correct way

2006-04-25 Thread jnair
ok , got it . Thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: how to browse using urllib2 and cookeilib the correct way

2006-04-25 Thread Edward Elliott
[EMAIL PROTECTED] wrote: > can anybody explain, in the first case why i need to do two attempts. I would guess it's because redhat requires your browser to submit a session cookie with the login form. In the urllib2 example, the first request you make tries to submit login form data directly. Si

how to browse using urllib2 and cookeilib the correct way

2006-04-25 Thread jnair
Hi , I am using python2.4 "urllib2" and "cookelib". In line "5" below i provide my credentials to login into a web site.During the first attempt i "fail", judging from the output of line "6". I try again and the second time i succeed,judging from the output of line "8". Now using the "twill" modu

how to browse using urllib2 and cookeilib the correct way

2006-04-25 Thread jnair
Hi , I am using python2.4 "urllib2" and "cookelib". In line "5" below i provide my credentials to login into a web site.During the first attempt i "fail", judging from the output of line "6". I try again and the second time i succeed,judging from the output of line "8". Now using the "twill" modu