วันเสาร์ที่ 7 กรกฎาคม พ.ศ. 2561

ลง PhantomJS และ CasperJS บน C.H.I.P

ลง PhantomJS ก่อน (ต้อง version มากกว่า 1.9.1)
https://github.com/ApioLab/phantomjs-2.1.1-linux-arm
แต่ ไม่ต้อง cd /tmp หรอก เอาไว้ที่ / นี่แหล่ะ เพราะใส่ใน /tmp เดี๋ยวมันก็โดนลบไป
$ wget https://raw.githubusercontent.com/ApioLab/phantomjs-2.1.1-linux-arm/master/phantomjs-2.1.1-linux-arm.tar.bz2 $ bunzip2 phantomjs-2.1.1-linux-arm.tar.bz2 $ tar xvf phantomjs-2.1.1-linux-arm.tar

ต่อไปลง CasperJShttp://docs.casperjs.org/en/latest/installation.html
$ git clone git://github.com/casperjs/casperjs.git $ cd casperjs $ ln -sf `pwd`/bin/casperjs /usr/local/bin/casperjs

วิธีการดู log ของ CasperJS ว่ามันมี error อะไร โดยไม่ต้องติดตั้ง MTA
casperjs xxxx.js >> /tmp/file.log 2>&1