I'm trying to open two or more separate windows.
I was able to open the first window by running
from selenium import webdriver
import undetected_chromedriver.v2 as uc
options = webdriver.ChromeOptions()
options.add_argument(r"--user-data-dir=C:\Users\username\AppData\Local\Google\Chrome\User Data")
drivers = list()
drivers.append(uc.Chrome(options=options))
Now I tried to open the second window by simply repeating the last line (drivers.append(uc.Chrome(options=options))), but it returned
RuntimeError: you cannot reuse the ChromeOptions object
So I tried
options = webdriver.ChromeOptions()
options.add_argument(r"--user-data-dir=C:\Users\username\AppData\Local\Google\Chrome\User Data")
drivers.append(uc.Chrome(options=options))
This time it returned
WebDriverException: unknown error: cannot connect to chrome at 127.0.0.1:54208
from chrome not reachable
How can I fix this?