Skip to content
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

Merged
merged 3 commits into from Jul 7, 2018

Conversation

nshores
Copy link
Contributor

@nshores nshores commented Apr 21, 2018

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.

@brianjking
Copy link

@nshores Does this work on a RaspberryPi?

@nshores
Copy link
Contributor Author

nshores commented Apr 27, 2018

@brianjking Based on some minimal research, it appears that it Selenium supports Firefox on RasberryPI without issues. First example I found -

Using OS: Raspbian based on Debian Stretch (Sep 7, 2017, linux kernel v4.9) Firefox 52.5.0 (sudo apt-get install firefox-esr) geckodriver v0.17.0 for ARM7

https://raspberrypi.stackexchange.com/questions/75409/running-selenium-firefox-geckodriver-on-raspberry-pi-2-model-b

@jcconnell
Copy link

@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':
Copy link

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

@nshores
Copy link
Contributor Author

nshores commented May 31, 2018

@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/

@jcconnell
Copy link

@nshores Thanks. Any reason why both Chrome and Firefox are installed? Will I need both?

@nshores
Copy link
Contributor Author

nshores commented May 31, 2018

@jcconnell Nope, I just haven't removed the chrome support yet due to laziness. You'll just want GeckoDriver and Firefox

@happyleavesaoc happyleavesaoc merged commit 34f704e into happyleavesaoc:master Jul 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants