Cookies manipulation

It is possible to manipulate cookies using the cookies attribute from a Browser instance. The cookies attribute is an instance of the CookieManager class that manipulates cookies (ie: adding and deleting).

Retrieve all cookies

cookies = browser.cookies.all()

Delete all cookies

browser.cookies.delete_all()

For more details check the API reference of the CookieManager class.

Extra Arguments

Each driver accepts various parameters when creating cookies. These can be used with browser.cookies.add as extra arguments. For example, WebDriver can use path, domain, secure, and expiry:

::
browser.cookies.add({‘cookie_name’: ‘cookie_value’}, path=’/cookiePath’)