Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

selenium get cookies python

# Here is a sample code from https://www.selenium.dev/documentation/webdriver/browser/cookies/

from selenium import webdriver

driver = webdriver.Chrome()

# Navigate to url
driver.get("http://www.example.com")

# Adds the cookie into current browser context
driver.add_cookie({"name": "foo", "value": "bar"})

# Get cookie details with named cookie 'foo'
print(driver.get_cookie("foo"))
Source by python-forum.io #
 
PREVIOUS NEXT
Tagged: #selenium #cookies #python
ADD COMMENT
Topic
Name
3+4 =