小编Abd*_*oud的帖子

使用 python 和 selenium 自动化谷歌登录显示““此浏览器或应用程序可能不安全”“

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

错误图像

我也尝试过在我的 acc 中启用安全性较低的应用程序等选项,但它没有用。然后我创建了一个新的谷歌帐户,它对我有用。但不是我的旧acc。

  1. 我该如何解决这个问题?
  2. 我怎样才能在普通的 Chrome 浏览器中打开 selenium 而不是由自动化软件控制的浏览器?

    这是我的代码
    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

9
推荐指数
3
解决办法
5039
查看次数