Below is my script:
# -*- coding: UTF-8 -*-
from selenium import webdriver
driver = webdriver.Firefox()
driver.get(\"http://www.google.com\")
all_cookies = dr
Cookies contain a lot more information than simply name and value information, for example expiration date, domain, etc. Therefore, a simple key/value pair is not sufficient. If all you're interested in ONLY the name and its corresponding value, then I'd do something similar to the following to construct your own dictionary:
# -*- coding: UTF-8 -*-
from selenium import webdriver
driver = webdriver.Firefox()
driver.get("http://www.google.com")
cookies_list = driver.get_cookies()
cookies_dict = {}
for cookie in cookies_list:
cookies_dict[cookie['name']] = cookie['value']
print(cookies_dict)