Selenium - Sharing a browser session (cookies, local storage) between computers

I need to transfer a Selenium session between two computers.

To export and import cookies through Selenium, you need to visit each website separately before you can set its cookies, and I want to avoid this. I also want to copy the contents of the local storage.

Here is what I have tried so far:

1 - Launch a new Selena session:

driver = webdriver.Chrome()

2 - find the temporary user profile of Chrome in% temp% and copy it to the application folder

3 - Launch a new driver using this user profile:

chrome_options = webdriver.ChromeOptions()
chrome_options.add_argument("user-data-dir=C:\\profiles\\temp_profile")
driver = webdriver.Chrome(chrome_options=chrome_options)

: cookie , , , , cookie .

chrome, Chrome Selenium, cookie .

+4
1

cookie SQLite Chrome, , ( ...), . , .

, , WebDriver . . .

+3

Source: https://habr.com/ru/post/1670710/


All Articles