newbie needs help with cookielib

2011-05-04 Thread Sells, Fred
I'm using Python 2.4 and 2.7 for different apps. I'm happy with a solution for either one. I've got to talk to a url that uses a session cookie. I only need to set this when I'm developing/debugging so I don't need a robust production solution and I'm somewhat con

[2.5.1/cookielib] How to display specific cookie?

2010-04-07 Thread Gilles Ganault
Hello I'm using ActivePython 2.5.1 and the cookielib package to retrieve web pages. I'd like to display a given cookie from the cookiejar instead of the whole thing: #OK for index, cookie in enumerate(cj): print index, ' : ', cookie #How to di

[cookielib] How to add cookies myself?

2008-12-16 Thread Gilles Ganault
don't know how to do this and Google didn't return examples: = import urllib import urllib2 import cookielib headers = {'User-Agent' : 'Mozilla/4.0 (compatible; MSIE 5.5; Windows NT)'} cj = cookielib.CookieJar() opener = urllib2.build_opener(

Re: Cookielib in Jython

2008-10-06 Thread Felipe De Bene
On Oct 6, 10:36 am, [EMAIL PROTECTED] wrote: > On 6 Ott, 13:19, Felipe De Bene <[EMAIL PROTECTED]> wrote: > > > > > Hi There, > > I'm trying to run an App I wrote in Python 2.5.2 in Jython 2.2.1 and > > everything works fine except when I try to import the

Re: Cookielib in Jython

2008-10-06 Thread bieffe62
On 6 Ott, 13:19, Felipe De Bene <[EMAIL PROTECTED]> wrote: > Hi There, > I'm trying to run an App I wrote in Python 2.5.2 in Jython 2.2.1 and > everything works fine except when I try to import the Standard > CPython's cookielib. I know this may sound stupid, I could us

Cookielib in Jython

2008-10-06 Thread Felipe De Bene
Hi There, I'm trying to run an App I wrote in Python 2.5.2 in Jython 2.2.1 and everything works fine except when I try to import the Standard CPython's cookielib. I know this may sound stupid, I could use an advice here on what's wrong. Thanks in advance, Felipe. Output:

Re: Handling cookies without urllib2 and cookielib

2007-12-17 Thread Joshua Kugler
ods, which urllib2 does not do. >> >> We also need client-side cookie handling. So, I start reading about >> cookielib and run across a problem. It's cookie handling is tied quite >> tightly to urllib2's request object. httplib has somewhat different >> se

Re: Handling cookies without urllib2 and cookielib

2007-12-15 Thread Gabriel Genellina
lso need client-side cookie handling. So, I start reading about > cookielib and run across a problem. It's cookie handling is tied quite > tightly to urllib2's request object. httplib has somewhat different > semantics in its request object. So, you can use cookielib with h

Handling cookies without urllib2 and cookielib

2007-12-14 Thread Joshua Kugler
ib2 does not do. We also need client-side cookie handling. So, I start reading about cookielib and run across a problem. It's cookie handling is tied quite tightly to urllib2's request object. httplib has somewhat different semantics in its request object. So, you can use cookielib with

Re: cookielib

2007-08-11 Thread John J. Lee
knows not to include the tag because it received the cookie). This tag can be supported by appropriate Python code. So, two HTTP requests needn't necessarily mean two urlopen calls. This library handles refresh redirections, and supports essentially the same interface as urllib2 and cookielib (the union of the two interfaces): http://wwwsearch.sourceforge.net/mechanize/ John -- http://mail.python.org/mailman/listinfo/python-list

cookielib

2007-08-10 Thread Boris Ozegovic
Hi I have HTTP client which accepts cookies. If client allready has cookie, but that cookie has expired, server sends him new cookie, and in response object Set-Cookie: header everything is fine, but if I reload request, client sends expired cookie, and not the new one. In cookiejar there is onl

Re: Log-in to forums (using cookielib)?

2007-05-01 Thread Gabriel Genellina
(I'm admin on the forum > where I need this). The program first needs to read the topic for > certain words (that's already working), and then reply that those words > aren't welcome. I would verify that in the forum code if possible, not remotely. Anyway, t

Re: Log-in to forums (using cookielib)?

2007-05-01 Thread Olivier Oost
Gabriel Genellina wrote: > En Tue, 01 May 2007 04:44:57 -0300, Olivier Oost <[EMAIL PROTECTED]> > escribió: > >> I need to login to a online forum, like a phpbb forum, and leave a >> message there. I figured I need to use cookielib, but the >> documentation of

Re: Log-in to forums (using cookielib)?

2007-05-01 Thread Gabriel Genellina
En Tue, 01 May 2007 04:44:57 -0300, Olivier Oost <[EMAIL PROTECTED]> escribió: > I need to login to a online forum, like a phpbb forum, and leave a > message there. I figured I need to use cookielib, but the documentation > of cookielib is not very clear to me. > Can some

Log-in to forums (using cookielib)?

2007-05-01 Thread Olivier Oost
Hi, I need to login to a online forum, like a phpbb forum, and leave a message there. I figured I need to use cookielib, but the documentation of cookielib is not very clear to me. I tried to just copy/paste all the cookies from FireFox into my Python-program, like this: import cookielib

Re: Question about using cookielib in python 2.4

2007-03-30 Thread John J. Lee
[EMAIL PROTECTED] writes: > Hi, > I am following the example of Python cookbook (14.7) about using > cookielib in python2.4 > > cj = cookielib.LWPCookieJar() > // code to send out the request > print "Coookie-"

Question about using cookielib in python 2.4

2007-03-29 Thread Marko . Cain . 23
Hi, I am following the example of Python cookbook (14.7) about using cookielib in python2.4 cj = cookielib.LWPCookieJar() // code to send out the request print "Coookie-" if cj is not None: for index, cookie in en

Re: Create a cookie with cookielib

2007-02-10 Thread John J. Lee
I'm going to post this if it kills me (this was my first response in this thread, my normal newsfeed has gone bad so can't post reliably...) Alessandro Fachin <[EMAIL PROTECTED]> writes: > Hi, i am trying to forge a new cookie by own with cookielib. But i don't >

Re: Create a cookie with cookielib

2007-02-04 Thread Alessandro Fachin
John J. Lee wrote: > Fine, but see my other post -- I think you misunderstand how cookies > work. Maybe you misunderstand me... While i wrote "cookie are simply http header :)" i want to said that i've look at wrong thing, cookielib are not needed... Anyway thank you for hel

Re: Create a cookie with cookielib

2007-02-04 Thread John J. Lee
g/lib/request-objects.html > > Yes is exactly what i want to do... i don't known because i looked at No, you don't ;-) > cookielib to set cookie data, cookie are simply http header :) Inserting > values with add_header() or addheaders() it works. Thank you Fine, but see my

Re: Create a cookie with cookielib

2007-02-04 Thread John J. Lee
"Matthew Franz" <[EMAIL PROTECTED]> writes: > I'm not sure what you mean be forge, but if you mean set an arbitrary > cookie manually (vs. one that was provided by the server). just use > add_header() in http://docs.python.org/lib/request-objects.html > > It may be possible to use CookieJar for

Re: Create a cookie with cookielib

2007-02-04 Thread Alessandro Fachin
wn because i looked at cookielib to set cookie data, cookie are simply http header :) Inserting values with add_header() or addheaders() it works. Thank you > It may be possible to use CookieJar for this purpose but I've only > used it for manipulating cookies set by the server... >

Re: Create a cookie with cookielib

2007-02-03 Thread Matthew Franz
nipulating cookies set by the server... And I would agree that Python cookie APIs are less intuitive than what are available in others such as Jakarta HttpClient - mdf On 2/3/07, Alessandro Fachin <[EMAIL PROTECTED]> wrote: > Hi, i am trying to forge a new cookie by own with coo

Create a cookie with cookielib

2007-02-03 Thread Alessandro Fachin
Hi, i am trying to forge a new cookie by own with cookielib. But i don't still have success. This a simply code: import cookielib, urllib, urllib2 login = 'Ia am a cookie!' cookiejar = cookielib.CookieJar() urlOpener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cookiejar))

Re: cookielib incorrectly escapes cookie

2006-07-09 Thread John J. Lee
rsion on Michael's website has been updated recently, so use the version linked to above instead. > unable to return them to a server. Specifically the script im trying > to do logs on to a server, get a session cookie and then tries to > access a secure page using the same session cookie

cookielib incorrectly escapes cookie

2006-07-05 Thread BJörn Lindqvist
do logs on to a server, get a session cookie and then tries to access a secure page using the same session cookie. But the cookie header cookielib produces is very different from the header it received. This example demonstrates it: import cookielib import urllib import urllib2 # Install an opene

Re: cookielib

2006-02-22 Thread Rene Pijlman
sri2097: >urllib2 does not support cookies. It does in 2.4. This code enables cookie support in all consequent calls through urrlib2: import cookielib, urllib2 opener = urllib2.build_opener(urllib2.HTTPCookieProcessor()) urllib2.install_opener(opener) -- René Pijlman -- h

Re: cookielib

2006-02-22 Thread Paul Rubin
"sri2097" <[EMAIL PROTECTED]> writes: > Hi, I need to get to a particular page in a website. The site uses > cookeis and naturally I had to use cookielib since urllib2 does not > support cookies. It's poorly documented but urllib2 does support cookies now. http://d

cookielib

2006-02-22 Thread sri2097
Hi, I need to get to a particular page in a website. The site uses cookeis and naturally I had to use cookielib since urllib2 does not support cookies. But even after adding the cookies to the headers, I keep getting a error message from the web-site saying that - 'My Browser has disabled co

cookielib extracting a cookie value as a string

2006-01-27 Thread dmbkiwi
I am trying to extract the value of a cookie from a CookieJar() object using cookielib. I have a CookieJar() object called cj. Printing cj gives: <_LWPCookieJar.LWPCookieJar[, ]> But i can't work out how to extract the value. If I use make_cookies(), I get: [Cookie(version=0,

Re: RFC 2965 cookies, cookielib, and mailman.

2005-02-13 Thread Titus Brown
lt;[EMAIL PROTECTED]> To: Titus Brown <[EMAIL PROTECTED]> Subject: Re: RFC 2965 cookies, cookielib, and mailman. X-Spam-Status: No, hits=0.0 tagged_above=-10.0 required=5.0 tests= X-Spam-Level: If you don't mind, could you forward this reply to python-list@python.org and [EM

RFC 2965 cookies, cookielib, and mailman.

2005-01-30 Thread John J Lee
hich are by default rejected by cookielib. I don't remotely pretend to > understand the issues involved; hence my post ;). > > A few questions for those more clued in than me: > > * what is the difference between RFC 2965 cookies and others? See "Where can I find out more a

Re: cookielib and urllib2: thread-safe?

2005-01-29 Thread John J. Lee
Alex Hunsley <[EMAIL PROTECTED]> writes: > I'm writing a test script in python for pulling web pages from a web > server using urllib2 and cookielib. Since the main thing I am testing > is what happens when concurrent requests are made to the web server, I > need t

cookielib and urllib2: thread-safe?

2005-01-26 Thread Alex Hunsley
I'm writing a test script in python for pulling web pages from a web server using urllib2 and cookielib. Since the main thing I am testing is what happens when concurrent requests are made to the web server, I need to make several requests concurrently, which I'll do from different

RFC 2965 cookies, cookielib, and mailman.

2004-12-27 Thread C. Titus Brown
Hi all, just spent some time playing with cookielib in Python 2.4, trying to get the cookielib example [0] to work with my mailman admindb page. The problem was that cookies weren't getting saved. The issue turned out to be that mailman sends out RFC 2965 [1] cookies, which are by default rej