Hi All,

I need to read cookie using Python api. I have tried below library:
1. webdriver of selenium
2. urllib2
3. cookie jar.

for all the above library I am getting different cookie id if I fire same 
URL using above code.

Note : If I use browser and fire same command I get same cookie id. below 
are the code.. 

from selenium import webdriver
driver = webdriver.Firefox()

driver.get("abc.com")

cookies = driver.get_cookies()
for cookie in cookies:
    print(cookie['name'] + ' --> ' + cookie['value'])
    print cookie['domain']
    print cookie['expiry']
    print cookie['path']
print "*=*"*10  

============================

from urllib2 import Request, build_opener, HTTPCookieProcessor, HTTPHandler
import cookielib
cj = cookielib.CookieJar()
opener = build_opener(HTTPCookieProcessor(cj), HTTPHandler())
req = Request("abc.com")
f = opener.open(req)
print "the cookies are: "
for cookie in cj:
    print cookie

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/2ddd33ff-eb91-49c4-bd0b-4e463049f6b3%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to