You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// a phantomjs examplevarpage=require('webpage').create();phantom.outputEncoding="gbk";page.open("http://www.cnblogs.com/front-Thinking",function(status){if(status==="success"){console.log(page.title);}else{console.log("Page failed to load.");}phantom.exit(0);});
The text was updated successfully, but these errors were encountered:
安装
去官网下载phantomjs的压缩文件并安装
PhantomJS官方地址
PhantomJS官方API
PhantomJS官方示例
PhantomJS GitHub
环境变量
打开我的电脑->右键属性->高级系统设置->高级标签->环境变量,在系统变量里找到Path将你的
phantomjs
添加到环境变量里。比方说我的路径添加的为D:\workspace\phantomjs\bin,切记不要少了前面那个分号运行
可以开始我们的第一个PhantomJS程序了。打开你的工作目录,新建文件hello.js,敲入以下代码,
phantomjs hello.js
The text was updated successfully, but these errors were encountered: