我尝试使用 Gmail 或任何 Google 服务登录,但它显示以下“此浏览器或应用程序可能不安全”消息:

我也尝试过在我的 acc 中启用安全性较低的应用程序等选项,但它没有用。然后我创建了一个新的谷歌帐户,它对我有用。但不是我的旧acc。
from selenium.webdriver import Chrome
from selenium.webdriver.chrome.options import Options
browser = webdriver.Chrome()
browser.get('https://accounts.google.com/servicelogin')
search_form = browser.find_element_by_id("identifierId")
search_form.send_keys('mygmail')
nextButton = browser.find_elements_by_xpath('//*[@id ="identifierNext"]')
search_form.send_keys('password')
nextButton[0].click()
Run Code Online (Sandbox Code Playgroud) python selenium automation selenium-chromedriver selenium-webdriver