Passing a Cookie with httplib

John J. Lee jjlee at
Thu Jun 29 23:34:58 CEST 2006

Grant Edwards <grante at> writes:

> On 2006-06-28, scott at <scott at> wrote:
> > From a shell script, I have used /usr/bin/curl to access a web site
> > and pass a cookie
> I use ClientCookie for that.

Note that ClientCookie has moved, to become part of mechanize (well,
is moving -- mechanize is still in beta):


mechanize exports a superset of the ClientCookie interface, so "import
mechanize as ClientCookie" should be all you need to do to switch
(modulo some trivial details, documented at the URL below).

Also note that module cookielib in the Python 2.4 stdlib contains most
of the functionality of ClientCookie (specifically, all the cookie
handling code, of course).


More information about the Python-list mailing list