curl-and-python

Save cookies using share object.

From: Antonio B <tpz0010_at_yahoo.es>
Date: Mon, 2 Mar 2009 15:41:12 -0800 (PST)

Hi All:

I'm using this piece of code:
 
        import pycurl

        s = pycurl.CurlShare()
        s.setopt(pycurl.SH_SHARE, pycurl.LOCK_DATA_COOKIE)

        c = pycurl.Curl()
        c.setopt(pycurl.URL, 'http://www.google.es')
        c.setopt(pycurl.SHARE, s)
        c.perform()

        c1 = pycurl.Curl()
        c1.setopt(pycurl.URL, 'http://www.google.com')
        c1.setopt(pycurl.SHARE, s)
        c1.perform()

        c.close()
        c1.close()

It can handle the cookies and share them between easy interfaces, even in in multiple interfaces; but it can save them in a cookie file. I'll try to use COOKIEFILE or COOKIEJAR as options in the easy interfaces, but it doesn't work either; in fact it doesn't matter if I use this options.

Thanks and any help will be appreciated.

      

_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-python
Received on 2009-03-03