简体   繁体   中英

How to run Selenium in pre-existing browser?

So, I made a web page on which I have a button that when clicked runs Selenium code (I'm writing in Python). I want my Selenium code to run in this existing, manually opened browser(in which I pre-opened this web page) rather than open new browser window. I already looked through all the similar questions here, but every answer requires opening chrome in debugging mode (which I want to avoid) or doesn't use this manually opened browser but some else. My idea is that there needs to be a way for me to get session id of my existing browser and "give" it to Selenium so it knows where to run. Any ideas, solutions? :)

It's officially not supported.

However, there is some working code which claims to support this:, Also this is in java I am sure you can make in your desire language

https://web.archive.org/web/20171214043703/http://tarunlalwani.com/post/reusing-existing-browser-session-selenium-java/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM