Nov-16-2020, 07:09 AM
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
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.