0

I'm trying to write a Python script to use Selenium log into a web page (I'll use Gmail as an example).

Some web pages, however, recognize when you log in from a new device, and ask for extra verification, such as texting codes to your phone etc. I would like to avoid this. Is there any way to control which device you appear as to a web page, and save that information in a config file so it's consistent across devices?

(Asking this out of curiosity as to whether Selenium can do this - I do not intent to log into my mail account this way and know it would be a terrible idea)

bjarkemoensted
  • 2,557
  • 3
  • 24
  • 37
  • Usually that sort of thing is done by changing the user agent string. Take a look at [this SO post](https://stackoverflow.com/a/29966769/1810205) on the subject. – Alexander Ryan Baggett May 07 '18 at 16:42
  • Also worth noting is that some google accounts have 2 step verification enabled, and thus require phone verification any time you sign-in on any device. – Alexander Ryan Baggett May 07 '18 at 16:45

0 Answers0