selenium.common.exceptions.InvalidArgumentException: Message: invalid argument: missing 'value'

1,073 views
Skip to first unread message

Kyle Dulay

unread,
Jun 25, 2019, 4:47:34 AM6/25/19
to Selenium Users
I updated chromedriver and now I am no longer able to add cookies to my webdriver, this worked previously with chromedriver 2.46.
Google Chrome 75.0.3770.100
Chromedriver 75.0.3770.90 
 
Here is my code for adding the cookies:

cookies = pickle.load(open(cookies_list[index], "rb"))
for cookie in cookies:
for key, value in cookie.items():
driver.add_cookie({'name': key, 'value': value})

Error I am getting:

selenium.common.exceptions.InvalidArgumentException: Message: invalid argument: missing 'value'

Example of cookies:

[{'domain': '.<DOMAIN>.com', 'expiry': 1876091194.864012, 'httpOnly': False, 'name': 'mid', 'path': '/', 'secure': True, 'value': '<VALUE>'}, {'domain': '.<DOMAIN>.com', 'httpOnly': True, 'name': 'urlgen', 'path': '/', 'secure': True, 'value': '"{\\"<IP>\\": <PORT>}"'}]

(The cookies are longer but I cut it short)

I verified the loop is working as intended by printing the values out.

Reply all
Reply to author
Forward
0 new messages