Answer the question
In order to leave comments, you need to log in
selenium python. How to work with an already open browser?
I work on linux using the firefox browser.
When you run the code, a new browser is always opened. I need the code to find an already open browser and work with it. Googling, I found out that you need to set the value of the executable_path variable, but this does not help. It still opens a new browser.
Maybe I entered the path incorrectly. But the driver is right there.
from selenium import webdriver
driver = webdriver.Firefox(executable_path='/usr/local/bin/geckodriver')
driver.get('http://www.google.com')
elem = driver.find_element_by_name('q')
elem.send_keys('Hello WebDriver!')
elem.submit()
Answer the question
In order to leave comments, you need to log in
I'm sorry, but what did you google?
There is still no such feature in Selenium, but you can find options
once or
twice
+ finish a little
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question