Skip to main content

Cookie handling for selenium webdrivers.

Project description

Selenium Cookie Handler

What does it do?

Saves and loads cookies from a given selenium webdriver.


Useful for storing user information amongst other things. This is actually ripped from my myNotifsV2 project where I save cookies in order to automatically log the user in rather than having them log in every single time they run the application.


pip install selenium_cookies


from selenium import webdriver
from selenium_cookies import CookieHandler
dummy_driver = webdriver.Firefox()
#   The second argument is the page to go to when saving/loading cookies.
#   In some cases this is necessary for the loading and saving of cookies
#   to actually work. If you don't have this issue, you can just set it to None.
cookie_handler = CookieHandler(dummy_driver,"", 
                               overwrite=False, filename="cooks.cookies", wait_time=5)
#   save_cookies() saves the site cookies to the specified file
cookies = cookie_handler.save_cookies()
#   load_cookies() loads the saved cookies from the given file (or from the most recently saved one)

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for selenium-cookies, version 0.0.2
Filename, size File type Python version Upload date Hashes
Filename, size selenium_cookies-0.0.2.tar.gz (3.0 kB) File type Source Python version None Upload date Hashes View
Filename, size selenium_cookies-0.0.2-py3-none-any.whl (3.9 kB) File type Wheel Python version py3 Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page