Below is my script:
# -*- coding: UTF-8 -*- from selenium import webdriver driver = webdriver.Firefox() driver.get("http://www.google.com") all_cookies = driver.get_cookies() print all_cookies
and print result:
>>> [{u'domain': u'.google.com.hk', u'name': u'PREF', u'value': u'ID=999c3b8cf82fb5bc:U=7d4d0968915e2147:FF=2:LD=zh-CN:NW=1:TM=1341066316:LM=1341066316:S=kDqT8587qbZJj1_B', u'expiry': 1404138316, u'path': u'/', u'secure': False}, {u'domain': u'.google.com.hk', u'name': u'NID', u'value': u'61=AbRSUZokdEP3hN79nLdNOWwlF7itUX9-pmFAIBb-ysJqvoi1NBsmOa2wV7ldWgXpYBd_OsPnMxaAPiRsJyCpVbCN882MWNn6DwNm9eD6PTKU2gfDfqrj2EJr6CNVUhI6', u'expiry': 1356877516, u'path': u'/', u'secure': False}] >>>
, u'value': u'61 = AbRSUZokdEP3hN79nLdNOWwlF7itUX9-pmFAIBb-ysJqvoi1NBsmOa2wV7ldWgXpYBd_OsPnMxaAPiRsJyCpVbCN882MWNn6DwNm9eD6PTKU2gfDfqrj2EJr6CNVUhI6 ', u'expiry': >>> [{u'domain': u'.google.com.hk', u'name': u'PREF', u'value': u'ID=999c3b8cf82fb5bc:U=7d4d0968915e2147:FF=2:LD=zh-CN:NW=1:TM=1341066316:LM=1341066316:S=kDqT8587qbZJj1_B', u'expiry': 1404138316, u'path': u'/', u'secure': False}, {u'domain': u'.google.com.hk', u'name': u'NID', u'value': u'61=AbRSUZokdEP3hN79nLdNOWwlF7itUX9-pmFAIBb-ysJqvoi1NBsmOa2wV7ldWgXpYBd_OsPnMxaAPiRsJyCpVbCN882MWNn6DwNm9eD6PTKU2gfDfqrj2EJr6CNVUhI6', u'expiry': 1356877516, u'path': u'/', u'secure': False}] >>>
Refund is a list, but it should be a dictionary.
source share