Skip to content

Instantly share code, notes, and snippets.

@moonzlo
Created June 8, 2019 01:41
Show Gist options
  • Select an option

  • Save moonzlo/5cb1ae449631c7cc608c251726eb6a32 to your computer and use it in GitHub Desktop.

Select an option

Save moonzlo/5cb1ae449631c7cc608c251726eb6a32 to your computer and use it in GitHub Desktop.
getCookies and sendCookies
# Load
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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment