Essentially as the title says, I am trying to use Selenium to automate some aspects of my job. But Selenium when initialized opens a unique version of Chrome so if I happen to click a link in lets say an Excel Doc or Teams then that link opens in a different Chrome than the one Selenium is using.
I am not sure what to try here to get links to open with the Selenium version of Chrome rather than the default version of Chrome as I am rather new to coding.
Here is my current code that initializes the browser:
def initialize_browser():
global driver
opt = Options()
profile_path = r'C:Usersusers_nameAppDataLocalGoogleChromeUser DataDefault'
opt.add_argument(f'user-data-dir={profile_path}')
driver = webdriver.Chrome(options=opt)
driver.get("Website I initially load") # Login URL
messagebox.showinfo("Login Required", "Please log in manually in the opened browser window. Close this message box once logged in.")
So I am wondering is there a way to make it to where if I click a link that it will instead open with the Chrome Browser that Selenium opens by default instead.
Anput is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.