0

I'm trying to log into a site using selenium but I come across this issue. After entering the username when the script is supposed to enter the password, that page appears. When I do the same manually in chrome browser, I get success.

I've tried with:

from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC

link = 'https://merchants.google.com/mc/default?hl=en&fmp=1&utm_id=gfr&mcsubid=us-en-z-g-mc-gfr'

username = "your_gmail_id"
password = "your_password"

driver = webdriver.Chrome()
wait = WebDriverWait(driver, 10)
driver.get(link)
wait.until(EC.presence_of_element_located((By.CSS_SELECTOR,"input#identifierId"))).send_keys(username)
wait.until(EC.presence_of_element_located((By.CSS_SELECTOR,"#identifierNext"))).click()
wait.until(EC.presence_of_element_located((By.CSS_SELECTOR,"input[aria-label='Enter your password']"))).send_keys(password)

How can I get rid of that barrier?

robots.txt
  • 96
  • 2
  • 10
  • 36
  • The solution I got here and the solutions in the link above couldn't solve the issue. How come this post becomes duplicate? – robots.txt Jun 23 '20 at 09:57
  • Finally, I've been able to solve the issue. I could paste here a working solution but the problem is the post is locked. – robots.txt Jun 24 '20 at 13:08

1 Answers1

1

Please try to activate the 'less secure app access' in your google account security configurations. Also, make sure you don't have 2-Step verification ON.

enter image description here

Mateo Lara
  • 827
  • 2
  • 12
  • 29
  • I've activated `less secure app access` option and deactivated `2-Step verification ON` but still having the same page that I've shown in the image while running the script. – robots.txt Jun 23 '20 at 09:06
  • What version of Chrome are you using? @robots.txt – Mateo Lara Jun 23 '20 at 09:59
  • 1
    This one `Version 83.0.4103.116 (Official Build) (32-bit)`. I'm really astonished to see that this post has been closed. – robots.txt Jun 23 '20 at 10:01
  • Please try the following: 1) Uninstall and install again google chrome to see if this solve the issue 2) Create a fake google account with no configurations and try to login using this new account 3) see this video https://www.youtube.com/watch?v=HkgDRRWrZKg&feature=youtu.be it have helped other people to solve the problem @robots.txt – Mateo Lara Jun 23 '20 at 10:33
  • I've followed all the steps possible. However, the link that I tried with in my post is still showing that page. – robots.txt Jun 23 '20 at 11:48
  • I even tried with [this link](https://accounts.google.com/signin/v2/identifier?continue=https%3A%2F%2Fmail.google.com%2Fmail%2F&service=mail&sacu=1&rip=1&flowName=GlifWebSignIn&flowEntry=ServiceLogin) and encountered the same issue. – robots.txt Jun 23 '20 at 12:05
  • At this point the only solution I can think of using selenium is to downgrade the google chrome version, please refer to the following link for more information: https://support.google.com/chrome/a/answer/7125792?hl=en another option is to open a new case in google help. @robots.txt – Mateo Lara Jun 23 '20 at 12:20
  • Tried with version 80 just now but no luck. Thanks. – robots.txt Jun 23 '20 at 13:10