7

I'm trying to automate sign in into gmail and I get to see this error.

enter image description here

I think this must be because the website is able to detect the automation and blocking it. Can you all please tell me how to overcome this? I don't see this issue with my personal account but this happens only with a common account.

Abhishek Boorugu
  • 164
  • 1
  • 1
  • 12

3 Answers3

3

In you account profile, in Security options, try setting this option: Security settings

2

This issue was because of the selenium chrome profile. I have created a new chrome profile and logged into it with the email id with which I was facing this issue. Then Turn on sync.

With this chrome profile in place I can skip the login steps and directly do the main process. Use: Chrome Options to add newly created chrome profile as an argument.

Hope this helps people who are facing similar challenge.

Abhishek Boorugu
  • 164
  • 1
  • 1
  • 12
  • I did exactly as suggested but Chrome launched from selenium was always asked to re-sign in upon which it insisted "Couldn't sign you in". When I clicked the User logo near the address bar, for a moment it seemed to want to skip the login but after a second later it decided that a login was required. – user1502776 Jan 05 '20 at 05:58
  • Did you save the login credentials in your chrome profile? Try manually opening chrome browser with the chrome profile that you have created and see if it is asking for credentials. – Abhishek Boorugu Jan 05 '20 at 06:04
  • Well, it did not ask for credential when I launched the browser manually but for some reason, launching the browser by selenium made google rejected it and asked to login again. There were a lot of preferences surfaced this month regarding to selenum and google (https://support.google.com/accounts/thread/22873505?hl=en). However, I still was not able to automate the login process with User agent changed. – user1502776 Jan 07 '20 at 04:19
  • Ohhh that's sad..! I was facing the same issue and struggled for one complete day to make it work. – Abhishek Boorugu Jan 07 '20 at 08:46
  • @AbhishekBoorugu I can't make out head or tails of your answer. Could you please elaborate a little bit? How are you creating a new chrome profile? Is this outside of the automation launch? What do you mean by "do the main process"? How do you add chrome profile as an argument? – Mugen Jun 16 '21 at 14:59
  • 1
    @Mugen I have used selenium to automate the process of downloading csv files from an advertising platform by google, but after few attempts we couldn't sign-in to the platform as we were hit by the blocker that you see in the screenshot above. My understanding is that, google servers were able to identify that we are using a bot because of selenium's chrome profile. In order to escape from this trap I have used my personal chrome profile in which I'm already signed-in and I can simply escape the login steps... continuing the actual file downloading process (main process - what I intend to do). – Abhishek Boorugu Jun 16 '21 at 15:55
  • 1
    To create new chrome profile you can simply google - "how to create new chrome profile" it is a 5-6 steps process. To use this chrome profile in your selenium script, follow this thread: https://stackoverflow.com/questions/52394408/how-to-use-chrome-profile-in-selenium-webdriver-python-3 – Abhishek Boorugu Jun 16 '21 at 15:59
  • @AbhishekBoorugu Beautiful method! Great work! – Mugen Jun 16 '21 at 16:39
1

I faced this issue. I have created dummy gmail account and now my selenium script is working fine for the same and able to login successfully.

it's not working for my personal gmail account.

Thanks !!

Yamini
  • 11
  • 1
  • I just found out that my script works with newly created account. Honestly I don't know what the difference is between my old junk account and newly created junk account. There shouldn't be any difference, settings or security options per se – user1502776 Jan 15 '20 at 05:45
  • I don't think you will face this challenge after signing in. For that reason you have to skip the sign in process using a chrome profile. You can create a new chrome profile, sign in and save your credentials in that profile. Now make your selenium script use that newly created chrome profile. – Abhishek Boorugu Jan 30 '20 at 09:44