4

When I'm writing a selenium python script, I have to start a session with some command like

driver = webdriver.Firefox()

However, this opens a new browser window.

What I would like is to have the window that is already open be accessed by the script, much like it would be if I have started the selenium IDE add-on (that cannot run python scripts afaik).

Could anybody please tell me if there is a way to do that?

user2565010
  • 1,876
  • 4
  • 23
  • 37
  • possible duplicate of [Can Selenium interact with an existing browser session?](http://stackoverflow.com/questions/8344776/can-selenium-interact-with-an-existing-browser-session) – Louis Jul 13 '15 at 10:22

1 Answers1

2

I've often wanted this functionality with Selenium and Python myself. Unfortunately, it's not part of Selenium's current features.

For more info, check out the answer threads here:

Can Selenium interact with an existing browser session?

(looks like someone came up with a hack solution, but I haven't tested it)

and here:

Can Selenium webdriver attach to already open browser window?

Good luck!

Community
  • 1
  • 1
Daniel
  • 2,345
  • 4
  • 19
  • 36