谷歌:不能';t使用selenium automation登录(浏览器或应用程序可能不安全)

谷歌:不能';t使用selenium automation登录(浏览器或应用程序可能不安全),selenium,selenium-webdriver,Selenium,Selenium Webdriver,所以我一直在尝试通过selenium访问我的gmail或Google Colab笔记本。 我不是通过电子邮件和密码进行身份验证,而是使用已保存的Google Chrome配置文件启动chromedriver,但它会抛出以下内容: 我曾经尝试过每一个以前有效的解决方案,但现在不起作用,我尝试过的一些解决方案是: 禁用双因素身份验证 允许不太安全的应用程序访问 禁用我知道的每个标志,让网站检测到该网站正由机器人控制 尝试使用其他网站的Google OAuth登录 尝试不同的视口 用户代理也与不使

所以我一直在尝试通过selenium访问我的gmail或Google Colab笔记本。 我不是通过电子邮件和密码进行身份验证,而是使用已保存的Google Chrome配置文件启动chromedriver,但它会抛出以下内容:

我曾经尝试过每一个以前有效的解决方案,但现在不起作用,我尝试过的一些解决方案是:

  • 禁用双因素身份验证
  • 允许不太安全的应用程序访问
  • 禁用我知道的每个标志,让网站检测到该网站正由机器人控制
  • 尝试使用其他网站的Google OAuth登录
  • 尝试不同的视口
  • 用户代理也与不使用selenium手动登录时使用的相同
什么都不管用!我有点困了,如果有任何帮助,我将不胜感激

非常感谢你

 options = Options()
 options.add_argument('--user-data-dir=/home/mubbashir/.config/google-chrome')
 options.add_argument('--profile-directory=Default')
 options.add_argument("--disable-blink-features")
 options.add_argument('--disable-web-security')
 options.add_argument('--allow-running-insecure-content')
 options.add_argument('--disable-blink-features=AutomationControlled')
 options.add_experimental_option("excludeSwitches", ["enable-automation"])
 options.add_experimental_option('useAutomationExtension', False)
 options.add_argument('--start-maximized')
 options.add_argument('Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko)  Chrome/89.0.4389.114 Safari/537.36')