pip install -U selenium
Install geckodriver from https://github.com/mozilla/geckodriver/releases
.
For GUI-mode you will need a fully functional Firefox installation.
Use headless
flag in constructor.
If betting wasn't successful an Exception will be thrown. You should catch it.