SeleniumBase/help_docs/webdriver_installation.md

63 lines
3.3 KiB
Markdown
Raw Normal View History

2018-08-01 02:47:10 +08:00
## Installing Google Chromedriver, Firefox Geckodriver, and Microsoft Edge Driver
2017-11-02 02:09:00 +08:00
2017-10-31 09:59:24 +08:00
2018-08-01 02:47:10 +08:00
To run web automation, you'll need to download a web driver for each browser you plan on using and place those on your System **[PATH](http://java.com/en/download/help/path.xml)**. Additionaly, you can place drivers in the [SeleniumBase `drivers` folder](https://github.com/seleniumbase/SeleniumBase/blob/master/drivers). If you plan on taking the latter option, here are some commands that'll automatically download the driver you need into the ``drivers`` folder once you've installed SeleniumBase:
```bash
seleniumbase install chromedriver
seleniumbase install geckodriver
seleniumbase install edgedriver
```
If you plan on using the [Selenium Grid integration](https://github.com/seleniumbase/SeleniumBase/blob/master/integrations/selenium_grid/ReadMe.md) (which allows for remote webdriver), you'll need to put the drivers on your System PATH. On a Mac and Linux, ``/usr/local/bin`` is a good PATH spot. On Windows, you may need to set the System PATH under Environment Variables to include the location where you placed the driver files. As a shortcut, you could place the driver files into your Python ``Scripts/`` folder in the location where you have Python installed, which should already be on your System PATH.
Here's where you can go to manually install web drivers from the source:
2017-10-31 09:59:24 +08:00
2018-03-26 09:07:05 +08:00
* For Chrome, get [Chromedriver](https://sites.google.com/a/chromium.org/chromedriver/downloads) on your System PATH.
2017-10-31 09:59:24 +08:00
2018-03-26 09:07:05 +08:00
* For Firefox, get [Geckodriver](https://github.com/mozilla/geckodriver/releases) on your System PATH.
2017-10-31 09:59:24 +08:00
2018-03-26 09:07:05 +08:00
* For Microsoft Edge, get [Edge Driver (Microsoft WebDriver)](https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/) on your System PATH.
2017-10-31 09:59:24 +08:00
2018-03-26 09:07:05 +08:00
* For Safari, get [Safari Driver](https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/using_safari_driver.md) on your System PATH.
2017-10-31 09:59:24 +08:00
2018-03-26 09:07:05 +08:00
* For PhantomJS headless browser automation, get [PhantomJS](http://phantomjs.org/download.html) on your System PATH. (NOTE: <i>PhantomJS is no longer officially supported by SeleniumHQ</i>)
2017-10-31 09:59:24 +08:00
2018-03-26 09:07:05 +08:00
**Mac**:
2017-10-31 09:59:24 +08:00
2018-08-01 02:47:10 +08:00
* On a Mac, you can also install drivers by using ``brew`` (aka ``homebrew``), but you'll need to install that first. [Brew installation instructions are here](https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/install_python_pip_git.md).
2017-10-31 09:59:24 +08:00
```bash
brew cask install chromedriver
2018-03-09 08:28:23 +08:00
brew install geckodriver
2017-10-31 09:59:24 +08:00
```
2018-08-01 02:47:10 +08:00
(NOTE: If your existing version of chromedriver is less than 2.41, **upgrading is required** in order to keep up with the latest version of Chrome!)
2017-10-31 09:59:24 +08:00
```bash
brew cask upgrade chromedriver
2018-03-09 08:28:23 +08:00
brew upgrade geckodriver
2017-10-31 09:59:24 +08:00
```
2018-03-26 09:07:05 +08:00
**Linux**:
2018-02-14 05:03:36 +08:00
2018-08-01 02:47:10 +08:00
If you still need the web drivers, here are some scripts to help you install chromedriver and geckodriver on a Linux machine:
2018-02-14 05:03:36 +08:00
```bash
2018-08-01 02:47:10 +08:00
wget http://chromedriver.storage.googleapis.com/2.41/chromedriver_linux64.zip
2018-02-14 05:03:36 +08:00
unzip chromedriver_linux64.zip
mv chromedriver /usr/local/bin/
chmod +x /usr/local/bin/chromedriver
```
```bash
2018-08-01 02:47:10 +08:00
wget https://github.com/mozilla/geckodriver/releases/download/v0.21.0/geckodriver-v0.21.0-linux64.tar.gz
tar xvfz geckodriver-v0.21.0-linux64.tar.gz
2018-02-14 05:03:36 +08:00
mv geckodriver /usr/local/bin/
chmod +x /usr/local/bin/geckodriver
```
2018-08-01 02:47:10 +08:00
* If you wish to verify that web drivers are working, **[follow these instructions](https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/verify_webdriver.md)**.