Working version with PhantomJS.