login website that using PHP

Fuzzyman fuzzyman at gmail.com
Mon Jun 20 12:38:37 CEST 2005


The behaviour with the browser is what is known as a 'session cookie'
-the site sets it when you login and the browser keeps it until you end
the session by closing the browser.

You handle the cookie using ClientCookie (Python 2.3) or cookielib
(Python 2.4). You need to create a cookiejar instance and an opener
that uses HTTPCookieProcessor (and your cookiejar).

When you've done that - calls to your opener will fetch pages and
handle the cookie *compeltely automatically*.

There is an example of doing that at
http://www.voidspace.org.uk/python/articles.shtml#http


The authentication is via an html form. You can handle this using
ClientForm - or you can look at the HTML source of the page and just
have your opener (as above) send the right values to the URL. If you
have problems - post the details here and people will help.

It is *possible* that the javascript does 'magic' on the form
submission (client side encryption is one possibility). That is very
hard to automatically duplicate from Python because you would need to
parse the python and mimic the page DOM to duplicate the effect. It
might be easier to use PAMIE to automate the form submission in the
browser. I've never tried this myself - but seen the announcements
here.

Best Regards,

Fuzzy
http://www.voidspace.org.uk/python
unfortunately voidspace is temporarily down :-(




More information about the Python-list mailing list