Headless Selenium on Ubuntu 14.04 with PhantomJS 2.0

Headless Selenium on Ubuntu 14.04 with PhantomJS 2.0

N.B. This is STILL incomplete.

More work later 🙂

We’re following the excellent Headless Selenium Testing With Python and PhantomJS

Install Selenium

Let’s use pip to install Selenium

$ pip install selenium

Install PhantomJS

To make PhantomJS installation easy we will use the GitHub Repository, PhantomJS 2.0 built on Ubuntu 14.04 x64.

  1. Let’s login as root, cd to the root home.
    $ # However you login as root - I use WinSCP & Putty.
    $ cd ~
    
  2. According to the notes on the GitHub, to avoid the noticed dependency error, first let’s install “libicu52”.
    $ sudo apt-get install libicu52
    
  3. Now let’s just follow the original instructions on the GitHub Repository.
    $ # Since the file the GitHub Repository is 
    $ #    **actually** the phantomjs **executable**, 
    $ # And we want system wide access,
    $ cd /usr/bin
    
    # Now do our GitHub Repository wget into /usr/bin
    $ $ wget https://github.com/Pyppe/phantomjs2.0-ubuntu14.04x64/raw/master/bin/phantomjs
    
    # Now change the permissions
    $ chmod 0755 phantomjs
    
    $ # -rwxr-xr-x 1 root root 56596085 Aug 26 09:22 phantomjs
    

    That does it.

Love and peace,
Joe

Advertisements