'Selenium sync with google account

i've created function using selenium undetected chromedriver in order to create a google chat with email specifeid. And every time i run my code i have to log in google account even though i turned sync on. How can i override it and do it only for once? (without pasting my gmail and password with code)

def func(gmail):

    driver = uc.Chrome(use_subprocess=True)
    wait = WebDriverWait(driver, 40)
    url = 'https://mail.google.com/chat/u/0/#chat/welcome'
    driver.get(url)

    wait.until(EC.visibility_of_element_located((By.XPATH, "/html/body/div[6]/div[3]/div/div[2]/div[1]/div[1]/div"                                   
                                                           "[1]/div[1]/div[2]\n" ))).click()
    time.sleep(1)

    driver.switch_to.frame(driver.find_element_by_id("talk_flyout"))
    driver.find_element(By.XPATH,"/html/body/c-wiz/div/div[3]/c-wiz/div[2]/div/c-wiz/div/div[1]"
                             "/div/div[1]/input").send_keys(gmail)
    time.sleep(1)
    wait.until(EC.visibility_of_element_located((By.CLASS_NAME, 'TEyOdc'))).click()

    while True:
        time.sleep(1)


func("[email protected]")


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source