casperJs的安装2

通过上面一节,以为能够顺利安装好phantom 没想到,根本没成功。

接着,通过github上下载项目,重新安装:

1.clone项目:【https://github.com/ariya/phantomjs】

如下:

uname -rsvo
       Linux 2.6.32-504.12.2.el6.x86_64 #1 SMP Wed Mar 11 22:03:14 UTC 2015 GNU/Linux

cat /etc/centos-release
       CentOS release 6.6 (Final)`
     git clone git://github.com/ariya/phantomjs.git phantomjs
     cd phantomjs
     git checkout 2.0
     ./build.sh --jobs 1
ldd bin/phantomjs
        linux-vdso.so.1 =>  (0x00007fff9f8f7000)
        libicudata.so.42 => /usr/lib64/libicudata.so.42 (0x000000388b600000)
        libssl.so.10 => /usr/lib64/libssl.so.10 (0x000000388b200000)
        libcrypto.so.10 => /usr/lib64/libcrypto.so.10 (0x0000003888600000)
        libfontconfig.so.1 => /usr/lib64/libfontconfig.so.1 (0x0000003887e00000)
        libfreetype.so.6 => /usr/lib64/libfreetype.so.6 (0x00007fba25217000)
        libjpeg.so.62 => /usr/lib64/libjpeg.so.62 (0x0000003887600000)
        libpng12.so.0 => /usr/lib64/libpng12.so.0 (0x000000388ce00000)
        libz.so.1 => /lib64/libz.so.1 (0x0000003884600000)
        libicui18n.so.42 => /usr/lib64/libicui18n.so.42 (0x0000003886600000)
        libicuuc.so.42 => /usr/lib64/libicuuc.so.42 (0x0000003885e00000)
        libdl.so.2 => /lib64/libdl.so.2 (0x0000003884200000)
        librt.so.1 => /lib64/librt.so.1 (0x0000003884a00000)
        libpthread.so.0 => /lib64/libpthread.so.0 (0x0000003883e00000)
        libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x0000003886a00000)
        libm.so.6 => /lib64/libm.so.6 (0x0000003884e00000)
        libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x0000003885600000)
        libc.so.6 => /lib64/libc.so.6 (0x0000003883a00000)
        /lib64/ld-linux-x86-64.so.2 (0x0000003883600000)
        libgssapi_krb5.so.2 => /lib64/libgssapi_krb5.so.2 (0x0000003889a00000)
        libkrb5.so.3 => /lib64/libkrb5.so.3 (0x0000003889200000)
        libcom_err.so.2 => /lib64/libcom_err.so.2 (0x0000003886e00000)
        libk5crypto.so.3 => /lib64/libk5crypto.so.3 (0x0000003889600000)
        libexpat.so.1 => /lib64/libexpat.so.1 (0x000000388aa00000)
        libkrb5support.so.0 => /lib64/libkrb5support.so.0 (0x0000003888e00000)
        libkeyutils.so.1 => /lib64/libkeyutils.so.1 (0x0000003887200000)
        libresolv.so.2 => /lib64/libresolv.so.2 (0x0000003885a00000)
        libselinux.so.1 => /lib64/libselinux.so.1 (0x0000003885200000)
bin/phantomjs --version 
       2.0.1-development

  已上参考【https://github.com/ariya/phantomjs/issues/12948】

至此实际上,你的phantom已经安装成功了,接着将执行文件加入环境变量里,就可以使用命令 

phantomjs --version 


事实上,接下来,改装casperjs了:
$ git clone git://github.com/n1k0/casperjs.git
$ cd casperjs
$ ln -sf `pwd`/bin/casperjs /usr/local/bin/casperjs

参考地址【http://docs.casperjs.org/en/latest/installation.html】

 很简单的,就安装完成了。接下来 就可以按照第一章中的指导,进行使用了。

posted @ 2016-01-13 21:07 suhanyujie 阅读(...) 评论(...) 编辑 收藏