Answers for "keep logged selenium"

1

keep logged selenium

#saving cookies


import pickle 
from selenium import webdriver 


driver = webdriver.Firefox() 
driver.get('http://www.quora.com') 
# login code 
pickle.dump(driver.get_cookies() , open("QuoraCookies.pkl","wb")) 


#loading cookies


import pickle 
from selenium import webdriver 


driver = webdriver.Firefox() 
driver.get('http://www.quora.com') 
for cookie in pickle.load(open("QuoraCookies.pkl", "rb")): 
    driver.add_cookie(cookie)
Posted by: Guest on February-08-2021

Code answers related to "keep logged selenium"

Python Answers by Framework

Browse Popular Code Answers by Language