Skip to content

Instantly share code, notes, and snippets.

@L42y
Last active December 16, 2015 06:19
Show Gist options
  • Save L42y/5390719 to your computer and use it in GitHub Desktop.
Save L42y/5390719 to your computer and use it in GitHub Desktop.
var page = require('webpage').create();
var fs = require("fs");
page.onLoadStarted = function() {
console.log('Now loading a new page...');
};
page.onLoadFinished = function () {
var file = fs.open('directive.html', 'w');
file.write(page.content);
file.close();
phantom.exit();
};
page.open('http://code.angularjs.org/1.1.4/docs/guide/directive');
var page = require('webpage').create();
var fs = require("fs");
page.onLoadStarted = function() {
console.log('Now loading a new page...');
};
page.onLoadFinished = function () {
var file = fs.open('hepai.html', 'w');
file.write(page.content);
file.close();
phantom.exit();
};
page.open('http://hepaimusic.com/');
var page = require('webpage').create();
var fs = require("fs");
page.onLoadStarted = function() {
console.log('Now loading a new page...');
};
page.onLoadFinished = function () {
var file = fs.open('L42y.html', 'w');
file.write(page.content);
file.close();
phantom.exit();
};
page.open('http://localhost:9000/L42y');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment