Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var page = require('webpage').create();
- page.settings.userName = 'your username here';
- page.settings.password = 'your password here';
- var url = "your url comes here";
- var fs = require('fs');
- var path = 'index.html'; //here you can use a format of the file you want .json .txt etc.
- page.open(url, function (status) {
- if(status !== 'success')
- console.log('Connection failed, page was not loaded!');
- else
- var content = page.content;
- fs.write(path,content,'w')
- phantom.exit();
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement