javascript - Blank page while trying to crawl angularjs based websites -
i trying crawl website using angularjs, when tried open, give blank page.
for example,the main website of angularjs - https://angularjs.org/ here code writing -
var page = require('webpage').create(); page.viewportsize = {width: 1280, height: 1024}; page.settings.useragent = 'mozilla/5.0 (x11; linux x86_64) applewebkit/537.36 (khtml, gecko) chrome/46.0.2490.86 safari/537.36'; page.settings.javascriptenabled = true; page.open('https://angularjs.org/', function(status) { if(status == 'success') { console.log("hello"); page.render('web.png'); phantom.exit(); } else { console.log("error opening page"); phantom.exit(); } });
Comments
Post a Comment