How can I save all cookies in Python\'s Selenium WebDriver to a txt-file, then load them later? The documentation doesn\'t say much of anything about the getCookies function
this is code I used in windows, It works.
for item in COOKIES.split(';'):
name,value = item.split('=',1)
name=name.replace(' ','').replace('\r','').replace('\n','')
value = value.replace(' ','').replace('\r','').replace('\n','')
cookie_dict={
'name':name,
'value':value,
"domain": "", # google chrome
"expires": "",
'path': '/',
'httpOnly': False,
'HostOnly': False,
'Secure': False
}
self.driver_.add_cookie(cookie_dict)