Python Forum
Not able to sign into gmail using selenium
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Not able to sign into gmail using selenium
#1
I am trying to automate gmail by downloading attachments from my inbox using selenium. But, it is showing me this error "This browser or app may not be secure". I looked around and found that OAuth will solve the problem. But, I don't know how to use it or if it is the right tool to use. Can anyone help me solve this error. Is Oauth the right tool? Will using any other browser solve the problem?

I am getting the Options() because I am not able to open chrome as it is not in the default location. If you have a solution for that too. Thanks

from selenium import webdriver
from selenium.webdriver.chrome.options import Options

options = Options()
options.binary_location = "/opt/google/chrome/google-chrome"    
options.add_argument("--start-maximized") 
options.add_argument("--no-sandbox") #bypass OS security model
options.add_argument("--disable-dev-shm-usage") 

options.add_experimental_option("excludeSwitches["enableautomation"])
options.add_experimental_option('useAutomationExtension', False)
driver = webdriver.Chrome(options=options, 
executable_path=r'./chromedriver')
driver.get('http://gmail.com/')
Error that is shown by gmail: 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.
Reply


Messages In This Thread
Not able to sign into gmail using selenium - by Leo_Red - Nov-16-2020, 07:09 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Gmail API - Error 400: redirect_uri_mismatch Depp 1 1,620 Jun-12-2022, 10:42 AM
Last Post: snippsat
  find a hyperlink in Gmail body python 3(imap and selenium) taomihiranga 1 8,223 Dec-30-2020, 05:31 PM
Last Post: Gamer1057
  How to send notifications to gmail from contact form using Django and pushbullet Justchse 0 1,892 Sep-01-2020, 01:19 PM
Last Post: Justchse
  Send email to gmail after user fill up contact form and getting django database updat Man_from_India 0 2,131 Jan-22-2020, 03:59 PM
Last Post: Man_from_India
  Error in Selenium: CRITICAL:root:Selenium module is not installed...Exiting program. AcszE 1 3,664 Nov-03-2017, 08:41 PM
Last Post: metulburr
  How to enter value in gmail id and password ratanbhushan 5 6,817 Nov-02-2017, 11:49 AM
Last Post: metulburr

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020