About a month ago (early Oct 2024) I found this thread and built my own POC based on stiky's code just to confirm it worked. Unfortunately, since then there have been changes to the Selenium Python codebase that break that method.
- The command_executor no longer has ._url, but it can be found in a new class as [executor]._client_config._remote_server_addr
- However, simply not calling driver.quit() at the end does not leave the browser running to be reconnected to... I'll do some looking around to see if I can understand what changed and if there's a way around it...
- But, it begs the question of long-term viability, if the method relies on "private" variables and side-effects.
It would be nice to have this capability as an official feature, but I may be forced to rearchitect my particular project around keeping a long-lived "owner" process holding the webdriver for however long I need it.