-
PhantomJS, CasterJS 설치 및 사용IT Information/최신 기술 동향 2013. 11. 1. 19:28반응형
PhantomJS: is a headless WebKit with JavaScript API. (WebKit:Chrome, safari 등 브라우저 없이 JS를 사용할 수 있음)
CasperJS: is a navigation scripting & testing utility that runs on top/alongside of PhantomJS.
The Api of Phantom JS is based on JavaScript: how would you execute code in a browser? Web sites JavaScript code is sandboxed, so that it does not interact with the main tool. Nothing is rendered to the screen like Selenium, we use the command-line.
PhantomJS
공식사이트
설치, 사용설명
http://nodeqa.com/nodejs_ref/86
http://mobicon.tistory.com/237
예제
https://github.com/ariya/phantomjs/tree/master/examples
----설치요약
Guidouil's answer put me on the right track. I had to add one additional symlink to /usr/bin/, and I did direct symlinks for all 3 - see below.
I'm installing on Ubuntu server Natty Narwhal.
This is exactly what I did.
cd /usr/local/share
wget http://phantomjs.googlecode.com/files/phantomjs-1.9.1-linux-x86_64.tar.bz2
tar -xjf phantomjs-1.9.1-linux-x86_64.tar.bz2
sudo ln -s /usr/local/share/phantomjs-1.9.1-linux-x86_64/bin/phantomjs /usr/local/share/phantomjs
sudo ln -s /usr/local/share/phantomjs-1.9.1-linux-x86_64/bin/phantomjs /usr/local/bin/phantomjs
sudo ln -s /usr/local/share/phantomjs-1.9.1-linux-x86_64/bin/phantomjs /usr/bin/phantomjs
=>And finally when I do
phantomjs -v
I get 1.9.1
* when you get error like "error while loading shared libraries: libfontconfig.so.1: cannot open shared object file: No such file or directory"
=> apt-get install libfontconfig1
Thanks Guidouil. Perfect timing. I've been working on this for a whole day. Sorry, I don't have enough reputation yet to vote you up, yet.
If anyone sees any problems with what I've done, please let me know.
----------- 사용
phantomjs rasterize.js url imgname.jpg
CasperJS
공식사이트
https://github.com/n1k0/casperjs
설치, 사용설명
http://nodeqa.com/nodejs_ref/69
반응형'IT Information > 최신 기술 동향' 카테고리의 다른 글
호빗호빗 12월 젤 기대되는 영화 (0) 2013.12.04 Apach Log 파일 분석 방법 (0) 2013.11.08 Modernizr (0) 2013.10.21 jQuery 플러그인 제작 (0) 2013.10.21 콜백함수를 왜 사용하나? (0) 2013.10.09