I need to transfer my Selenium session between 2 computers.
To export and import the cookies via Selenium you have to visit each website individually before you can set its cookies, and I want to avoid that. I also want to copy over the local storage.
Here's what I've tried so far:
1 - Launch a fresh Selenium session:
driver = webdriver.Chrome()
2 - Find its temporary Chrome user profile in %temp% and copy it over to my application's 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)
The above works - the local storage and the cookies are still there on my local PC, however, when I copy this user profile to another PC and launch it, then the local storage is still there, but the cookies are gone.
I have also tried the same using a regular chrome profile, as well as trying to launch the user profile directly in Chrome instead of Selenium, and the cookies are still gone.