Answer the question
In order to leave comments, you need to log in
How to run Selenium Webdriver in an already open browser?
I use this code:
from selenium import webdriver
url =' https://google.com '
def page():
global driver
driver = webdriver.Chrome()
driver.get(url)
def main():
page()
if __name__ = = '__main__':
main()
How can I make it so that when the code is run, it opens a new tab in the already running Chrome/Firefox browser, and not a new browser page?
Those. I'm opening Chrome and I want a new tab to be added when I run the code in that Chrome browser.
Please help, I'm not very friendly with Python.
Answer the question
In order to leave comments, you need to log in
Why did you provide the code?
it is possible to do this, but not easy, and it will not be Chrome
How did you launch the browser? Code or hands?
If by hand, then you will not be able to connect to the existing browser
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question