I\'m trying to add cookies to a browser, but getting the following error:
Message: invalid argument: invalid \'expiry\' (Session info: chrome=75.0.3770.90)
T
The problem is that you are trying to add the cookies with a different format than the selenium expects.
The python selenium api reference says that you have to insert the cookies with a dict like that
driver.add_cookie({'name' : 'foo', 'value' : 'bar'})
So you have to adapt your loop to use a key,value format
for key, value in pickle.load(open(r'{0}\{1}_cookie.pkl'.format(settings.COOKIES_PATH, self.tv_username), 'rb')):
self.browser.add_cookie({'name' : key, 'value' : value})