Cookie handling for selenium webdrivers.
Project description
Selenium Cookie Handler
What does it do?
Saves and loads cookies from a given selenium webdriver.
Why?
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.
Installation
pip install selenium_cookies
Usage
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,"https://github.com/adamhb123/selenium_cookies",
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
selenium_cookies-0.0.2.tar.gz
(3.0 kB
view hashes)
Built Distribution
Close
Hashes for selenium_cookies-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c46e094db7db419d5f482a2d2bc6f0e47211160e714bfb24f8b9d244a9b3f9e6 |
|
MD5 | 5ecd96f49ae572fdbea547ea0f0829e6 |
|
BLAKE2b-256 | 7fef9dd36aecb1bfe97c9aec7d185bdfd337651b2fccc398964d330ace612e5d |