Answers for "python selenium get cookies from chrome browser"

3

python selenium save cookies

# read cookies

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)
Posted by: Guest on August-25-2020
0

python get cookie from browser

a_session = requests. Session()
a_session. get('https://google.com/')
session_cookies = a_session. cookies.
cookies_dictionary = session_cookies. get_dict()
print(cookies_dictionary)
Posted by: Guest on June-02-2021

Code answers related to "python selenium get cookies from chrome browser"

Python Answers by Framework

Browse Popular Code Answers by Language