0

"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."

Is there any way to sign in

This is the code:

from selenium import webdriver
import time

driver =webdriver.Chrome()

driver.get("https://www.gmail.com")
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("********")
time.sleep(5)
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()
time.sleep(5)
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("*******")
time.sleep(5)
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()
time.sleep(5)

driver.close()
MattDMo
  • 100,794
  • 21
  • 241
  • 231
vivek
  • 11
  • 2
  • https://stackoverflow.com/questions/60117232/selenium-google-login-block Your going to need to add user agents. – Arundeep Chohan Oct 02 '20 at 19:52
  • Does this answer your question? [“This browser or app may not be secure” error while attempting to login in to Gmail account using GeckoDriver Firefox through Selenium and Python](https://stackoverflow.com/questions/59515561/this-browser-or-app-may-not-be-secure-error-while-attempting-to-login-in-to-gm) – questioning Nov 29 '21 at 10:36

1 Answers1

0

I feel the issue is maybe due to the following reasons -

  1. As you are using a chrome webdriver (basically a automation tool) I think the debugger mode is on and that is why it is not allowing you to sign-in or check if

chrome.exe --remote-debugging-port=9222

is running in your IDE.

  1. Other reason maybe as Google only allows Secure login, you will not be able to login with a unsecure browser. You might have to

Turn On "Less secure app access"

From Google which is not recommended unless or un-till you are using a test Account.

Some apps and devices use less secure sign-in technology, which makes your account vulnerable. You can turn off access for these apps, which we recommend, or turn it on if you want to use them despite the risks. Google will automatically turn this setting OFF if it’s not being used.

If running Chrome normally (out of debug mode) is not an option, then check this https://support.google.com/accounts/thread/22873505?msgid=24501976.

Dharman
  • 30,962
  • 25
  • 85
  • 135
Suraj Bhandarkar
  • 346
  • 4
  • 11