If you want to use Selenium WebDriver with Chrome, first download ChromeDriver - WebDriver for Chrome. This can be installed via Homebrew with brew install chromedriver
, or manually by downloading, extracting, moving and setting the PATH
as follows:
$ cd $HOME/Downloads
$ wget http://chromedriver.storage.googleapis.com/2.22/chromedriver_mac32.zip
$ unzip chromedriver_mac32.zip
$ mkdir -p $HOME/bin
$ mv chromedriver $HOME/bin
$ echo "export PATH=$PATH:$HOME/bin" >> $HOME/.bash_profile
Source: install and set path to chromedriver on mac or linux
You should then read Getting started with ChromeDriver on Desktop, in particular the sample code which shows how you map the path to the executable and instantiate ChromeDriver
. If you have a reference to the driver in the PATH
variable, you can omit the configuration line.
You can install both packed (.crx file) and unpacked (directory) extensions via ChromeDriver. See the code snippets for setting either up here.
If you were using Selenium IDE for FireFox instead, there is no version available for Chrome. The best alternative I know of is iMacros for Chrome.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…