New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Include support for Firefox webdriver #16
Conversation
@nshores Does this work on a RaspberryPi? |
@brianjking Based on some minimal research, it appears that it Selenium supports Firefox on RasberryPI without issues. First example I found -
|
@nshores, Do you have a link or some instructions available for how you installed and configured headless Firefox. @happyleavesaoc, just curious, any reason this hasn't been merged? |
@@ -142,6 +145,8 @@ def _get_driver(driver_type): | |||
"""Get webdriver.""" | |||
if driver_type == 'phantomjs': | |||
return webdriver.PhantomJS(service_log_path=os.path.devnull) | |||
if driver_type == 'firefox': |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider using elif
instead of if
@jcconnell - You should reference my docker image to get an idea of how it's built. The dockerfile shows each step of the install process -- https://hub.docker.com/r/nshores/my_usps_notifications/~/dockerfile/ |
@nshores Thanks. Any reason why both Chrome and Firefox are installed? Will I need both? |
@jcconnell Nope, I just haven't removed the chrome support yet due to laziness. You'll just want GeckoDriver and Firefox |
I've gone ahead and switched the default Selenium webdriver to Firefox, as there appears to be a recent change to the MyUSPS login form that is stopping Chromedriver or PhantomJS from being able to establish a session. The below code switches the default webdriver from PhantomJS to Firefox, implements other changes needed to support that WebDriver, and updates the default selenium version to 3.11 (the latest). This allows the library to work again in Windows and Linux.