Created
July 7, 2016 16:27
-
-
Save tristandostaler/2f8b28f2bf503db4422a5549e8fed538 to your computer and use it in GitHub Desktop.
How to install correctly python Selenium (tested on ubuntu gnome)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apt-get install ipython | |
apt-get install python-pip | |
pip install selenium | |
mkdir /root/bin | |
cd /root/bin | |
wget https://github.com/mozilla/geckodriver/releases/download/v0.9.0/geckodriver-v0.9.0-linux64.tar.gz | |
tar -xvzf geckodriver-v0.9.0-linux64.tar.gz | |
rm geckodriver-v0.9.0-linux64.tar.gz | |
chmod +x geckodriver | |
cp geckodriver wires | |
export PATH=$PATH:/root/bin/wires | |
export PATH=$PATH:/root/bin/geckodriver | |
: ' | |
ipython | |
%cpaste | |
## Paste the whole following content: | |
browser = None | |
def StartSelenium(): | |
import selenium | |
from selenium import webdriver | |
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities | |
import binascii | |
import hashlib | |
firefox_capabilities = DesiredCapabilities.FIREFOX | |
firefox_capabilities['marionette'] = True | |
firefox_capabilities['binary'] = '/usr/bin/firefox' | |
global browser | |
browser = webdriver.Firefox(capabilities=firefox_capabilities) | |
browser.get('https://www.google.com') | |
-- | |
##End of paste | |
' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
not sure where the wires binary came from. version 0.9.0 was broken for me as well. Downloading 0.13.0 at https://github.com/mozilla/geckodriver/releases/download/v0.13.0/geckodriver-v0.13.0-linux64.tar.gz fixed it for me.