Saturday, December 22, 2012

Clojure, Selenium-WebDriver, and PhantomJS

The following is a small manual of how to setup PhantomJS and use it from Clojure via clj-webdriver  - Clojure API for Selenium-WebDriver.


1. Start a new project using Leiningen:

2. Download PhantomJS from http://phantomjs.org/download.html and unpack it into your project's directory:

3. Now add the following to your project.clj file:


By the way, there is an awesome Leiningen plugin that checks if your dependencies are up to date.

4. Tell Leiningen to update dependencies:

5. Now let's start a REPL to check if everything's in its right place:

Hope it works! If not, ping me and I'll update the tutorial.