0

This question is a extension from How to get cookies from web-browser with Python?

I would like to extract cookies from the same url for 3 accounts logged into chrome. I've already done the code test from the previous url and it returns me only cookies from a single user. I have already researched the library and apparently does not have this functionality.

That is the code i'm using:

import browser_cookie3
from selenium import webdriver
driver = webdriver.Chrome('C:/Users/pedro/Desktop/chromedriver')
cookies = browser_cookie3.chrome(domain_name='my/url')
print('cookies._cookies')
Mithsew
  • 1,129
  • 8
  • 20

1 Answers1

0

Look into the selenium module. You are able to run Chrome (in selenium named a webdriver) from Python.

If you start the Chrome browser with selenium (and store it into a variable), you have the selenium webdriver and you are able to log in as you would normally do.

Then cookies = driver.get_cookies() leads to cookies being a dictionary, ready to use.

Reference

Matthias
  • 96
  • 4