Can't find any solution for auto login google (gmail) account.
Here is my code :
import os
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
import time
opt = Options()
executable_path = r'chromedriver'
os.environ["webdriver.chrome.driver"] = executable_path
opt.add_extension(r'C:\Users\SAMSUNG\Desktop\SB.crx')
opt.add_extension(r'C:\Users\SAMSUNG\Desktop\proxy.crx')
opt.add_argument('--disable-blink-features=AutomationControlled')
opt.add_experimental_option("excludeSwitches", ["enable-automation"])
opt.add_experimental_option('useAutomationExtension', False)
opt.add_argument("window-size=1280,800")
usernameStr = 'x'
passwordStr = 'y'
driver = webdriver.Chrome(r'C:\Users\SAMSUNG\Desktop\chromedriver', options=opt)
time.sleep(5)
driver.get(('https://accounts.google.com/ServiceLogin?'
'service=mail&continue=https://mail.google'
'.com/mail/#identifier'))
# fill in username and hit the next button
username = driver.find_element_by_id('identifierId')
username.send_keys(usernameStr)
time.sleep(2)
nextButton = driver.find_element_by_id('identifierNext')
nextButton.click()
# wait for transition then continue to fill items
password = WebDriverWait(driver, 10).until(
EC.presence_of_element_located((By.NAME, "password")))
password.send_keys(passwordStr)
signInButton = driver.find_element_by_id('passwordNext')
signInButton.click()
But i keep getting this error : This browser or app may not be secure. Learn more Try using a different browser. If you’re already using a supported browser, you can refresh your screen and try again to sign in.