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?

1

1 Answer 1

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!

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.