Advertisement
Guest User

Untitled

a guest
Dec 12th, 2016
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. var page = require('webpage').create();
  2.  
  3. page.settings.userName = 'your username here';
  4.  
  5. page.settings.password = 'your password here';
  6.  
  7. var url = "your url comes here";
  8. var fs = require('fs');
  9. var path = 'index.html'; //here you can use a format of the file you want .json .txt etc.
  10.  
  11. page.open(url, function (status) {
  12. if(status !== 'success')
  13. console.log('Connection failed, page was not loaded!');
  14. else
  15. var content = page.content;
  16. fs.write(path,content,'w')
  17. phantom.exit();
  18. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement