ufb4xa
Last Updated: November 18, 2017
·
15
· lazybios
97eb92522d043b54ef01a9128b7176c0

selenium and cookies

from selenium import webdriver
browser = webdriver.Chrome()
browser.get('http://dev.e.qq.com/dev/#finance?mbid=l877677309')
import pickle
import selenium.webdriver 

driver = selenium.webdriver.Firefox()
driver.get("http://www.google.com")
pickle.dump( driver.get_cookies() , open("cookies.pkl","wb"))
import pickle
import selenium.webdriver 

driver = selenium.webdriver.Firefox()
driver.get("http://www.google.com")
cookies = pickle.load(open("cookies.pkl", "rb"))
for cookie in cookies:
    driver.add_cookie(cookie)
Say Thanks
Respond