0

Basically I'm trying out Selenium webdriver (using FireFox) and right now I am trying to sign up to a Google account. However, the strange thing is that whenever I run Selenium and let it use the (empty I assume?) Selenium FireFox profile Google seems to detect it and block me (asking for phone vertification). This is even the case when I load up the selenium profile and manually sign up.

When I sign up manually (and don't use the selenium profile) I can sign up just fine.

Is the Selenium FireFox profile some how special which enables the servers to detect it?

EDIT: I'm trying to startup selenium with my default FF profile (however it keeps starting up in an empty profile) - here's the code:

OpenQA.Selenium.Proxy proxySetting = new OpenQA.Selenium.Proxy();
proxySetting.HttpProxy = proxy;
proxySetting.FtpProxy = proxy;
proxySetting.SslProxy = proxy;

FirefoxProfile profile = new FirefoxProfile("default");
profile.SetProxyPreferences(proxySetting);

profile.SetPreference("browser.privatebrowsing.autostart", true);

_driver = new FirefoxDriver(profile);

EDIT: I managed to open the default firefox profile but now it doesn't use my proxy settings. How can I use the normal profile and still customize the profile proxies?

JensOlsen112
  • 1,279
  • 3
  • 20
  • 26

3 Answers3

1

This post talks about an HtmlDriver tag being added to the HTML in the FirefoxDriver which would be a dead giveaway

Community
  • 1
  • 1
CraPo
  • 123
  • 9
0

Google is a strong supporter of Open Source, and even Selenium itself, however I don't think Google would particularly condone a Selenium script creating a bunch of spam accounts that probably would never be used, and just take space.

That being said, I believe that it would be possible potentially.

The only way that Google would be able to know you are using Selenium, is based on the Request Headers. It's possible either the User-Agent has something to do with Selenium, or one of the other Headers.

My solution would be to use something like Fiddler to listen to the requests that Firefox is sending, and then edit your Selenium scripts to account for, and change those requests so Google does not know that you are using Selenium.

This most likely goes against their terms of use, so exercise caution, and use this answer for educational purposes only.

ddavison
  • 28,221
  • 15
  • 85
  • 110
  • Thanks for your reply. I have already inspected the web request and it is identical to one without profile (except for a few of the standard cookies). The user agents are identical. Also, I'm not planning on spamming in any ways. I'm testing for learning/general enjoyment purposes on Google since I would assume they are the ones with the strongest "anti-bot" protection. – JensOlsen112 Feb 09 '15 at 16:52
  • if what you say is true, then that would mean that Google has their fingers in your computer deeper than they should be, and they can detect it internally, which would certainly raise some eyebrows and be cause for concern... maybe Selenium puts some cookies, and/or local storage variables that identify it as Selenium? – ddavison Feb 09 '15 at 16:55
  • It's worth checking out for sure. Right now I'm trying to start selenium in my default firefox profile to verify this. However I can't get it to startup the profile. I have added the code to my question. – JensOlsen112 Feb 09 '15 at 17:03
-1

Is there a chance, if you were using the complete path to your firefox profile directory? (e.g. C:\Users\???\AppData\Roaming\Mozilla\Firefox\Profiles\your_profile.default)

Storm
  • 728
  • 2
  • 7
  • 17