PHP 之PHP + phantomJS實現網站截屏

php代碼:php

exec("G:/phpstudy/WWW/destoon/api/a/cache/web/phantomjs.exe ./get.js http://www.baidu.com ./img/example.png");

js代碼:web

var page = require('webpage').create(), system = require('system');
var url = system.args[1], file_name = system.args[2];
page.open(url, function () {
    page.render(file_name);
    phantom.exit();
});

效果如圖:api

相關文章
相關標籤/搜索