curl-and-python

Re: Help with cookies

From: Nathan C. Tresch <ntresch_at_hotmail.com>
Date: Wed, 12 Dec 2007 10:18:25 -0800

Further, this is what I'm trying:

        self.c=pycurl.Curl()
        self.c.setopt(pycurl.FOLLOWLOCATION, 1);
        self.c.setopt(pycurl.VERBOSE, int(self.__verbose));
        self.c.setopt(pycurl.HEADER, 1);
        # self.c.setopt(pycurl.RETURNTRANSFER, 1);
        self.c.setopt(pycurl.USERAGENT, self.__userAgent);
        self.cookieFile=tempfile.NamedTemporaryFile(prefix=getURL.COOKIEFILE_PREFIX)
        self.c.setopt(pycurl.COOKIEFILE, self.cookieFile.name);
        self.c.setopt(pycurl.COOKIEJAR, self.cookieFile.name);

Then, later, I do this:

        print self.c.getinfo(pycurl.COOKIELIST)

What I get is:

ValueError: invalid argument to getinfo

Can anyone tell me what I'm doing wrong?
  ----- Original Message -----
  From: Nathan C. Tresch
  To: curl with python
  Sent: Wednesday, December 12, 2007 9:16 AM
  Subject: Help with cookies

  Can anyone tell me how to access the cookies stored by a given pycurl instance?

------------------------------------------------------------------------------

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

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