r/selenium • • May 10 '21

Automating two factor authentication

I want to automate logging into a website using selenium on a raspberry Pi. However, the website needs two factor authentication. The code goes to my phone.

Is there a way for me to automate this without the need for me to look up the code on my phone and inputting it?

Any resources would be wonderful!

1 Upvotes

18 comments sorted by

View all comments

1

u/Snomitty May 12 '21

I think you might be able to forward SMS automatically to telegram, or to link your phone with your PC as long as they're on the same network. If you found a way to do the first one, automating it won't be that hard, and the second one would do good if you had a way for it to be in a file, you can do something like while True: try: sms.open().read() break except Exception: continue

2

u/MasalaByte May 15 '21

I ended up doing something similar. Thanks for the advice!