So I am doing an automation task , where I login to website on new Chromium Edge and go to particular pages , once it is done , I want to use the Edge browser normally on that website itself, but saw that python script keeps running , and once I close the script the browser also closes
So what I want is that , once automation is complete , python script should end , and I should be able to use the Edge browser from that point normally , from the current page itself
I am using Edge as Browser like below add experimental option detach for Edge does not work
from msedge.selenium_tools import EdgeOptions
from msedge.selenium_tools import Edge
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
options = EdgeOptions()
options.use_chromium = True
options.add_experimental_option("detach", True)
driver = Edge(options=options)
driver.get("mywebsite")
element = WebDriverWait(driver, 10).until(
EC.presence_of_element_located(
(By.XPATH, "/html/body/header/nav/div/div[2]/a"))
)
element.click()
element = WebDriverWait(driver, 10).until(
EC.presence_of_element_located((By.ID, "username"))
)
element.send_keys("username")
element = WebDriverWait(driver, 10).until(
EC.presence_of_element_located((By.ID, "password"))
)
element.send_keys("password")
element = WebDriverWait(driver, 10).until(
EC.presence_of_element_located((By.ID, "continue"))
)
element.click()
Note : I am running the python script using cmd , and if close the cmd , no matter what the browser also closes