I
itay_k
Hi,
I want to send a cookie on some http request (with urllib2),
so I created a Cookie but I cant associate it with CookieJar object.
for example:
import Cookie
import cookielib, urllib2
C = Cookie.SimpleCookie()
C["a"] = "b"
cj = cookielib.CookieJar()
cj.set_cookie(C)
in the last line I got:
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "C:\Python24\lib\cookielib.py", line 1593, in set_cookie
if cookie.domain not in c: c[cookie.domain] = {}
AttributeError: 'SimpleCookie' object has no attribute 'domain'
why?
maybe.. there is any code example for sending cookie with some http
request operation?
thanks alot,
Itay.
I want to send a cookie on some http request (with urllib2),
so I created a Cookie but I cant associate it with CookieJar object.
for example:
import Cookie
import cookielib, urllib2
C = Cookie.SimpleCookie()
C["a"] = "b"
cj = cookielib.CookieJar()
cj.set_cookie(C)
in the last line I got:
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "C:\Python24\lib\cookielib.py", line 1593, in set_cookie
if cookie.domain not in c: c[cookie.domain] = {}
AttributeError: 'SimpleCookie' object has no attribute 'domain'
why?
maybe.. there is any code example for sending cookie with some http
request operation?
thanks alot,
Itay.