Error: Couldn't sign you in 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.
2FA is OFF and Less Secure Account is ON, already tried the same script with FireFox browser
Chrome: 90.0.44 and Python=3.9.5
Code:
from selenium import webdriver
video_url = 'https://www.youtube.com/watch?v=0WVDKZJkGlY'
driver = webdriver.Chrome()
driver.get('https://accounts.google.com/signin/v2/identifier?hl=en')
# click sign in button
# driver.find_element_by_xpath(
# '/html/body/ytd-app/div/div/ytd-masthead/div[3]/div[3]/div[2]/ytd-button-renderer/a/tp-yt-paper-button').click()
# Email Field
driver.find_element_by_xpath(
'/html/body/div[1]/div[1]/div[2]/div/div[2]/div/div/div[2]/div/div[1]/div/form/span/section/div/div/div[1]/div/div[1]/div/div[1]/input').send_keys('[email protected]')
# Next Button
driver.find_element_by_xpath(
'/html/body/div[1]/div[1]/div[2]/div/div[2]/div/div/div[2]/div/div[2]/div/div[1]/div/div/button/div[2]').click()
sleep(1)
# Password Field
driver.find_element_by_xpath(
'/html/body/div[1]/div[1]/div[2]/div/div[2]/div/div/div[2]/div/div[1]/div/form/span/section/div/div/div[1]/div[1]/div/div/div/div/div[1]/div/div[1]/input').send_keys('Careermaniaa@SagarYadav1908')
# Login Button
driver.find_element_by_xpath(
'/html/body/div[1]/div[1]/div[2]/div/div[2]/div/div/div[2]/div/div[2]/div/div[1]/div/div/button/div[2]').click()