javascript - Why can't CasperJS show part of a web site 'outlook.com'? -
i have problem of capturing of web page. after log in outlook.com using regular browser, should show inbox message in right side:
however, when use casperjs, blank. have idea?
i have include temporary login id in script, can test if can, thanks.
here script:
var casper = require('casper').create({ verbose: true, loglevel: "info", viewportsize: {width: 1280,height: 720}, pagesettings: {useragent: "mozilla/5.0 (macintosh; intel mac os x 10_8_2) applewebkit/537.11 (khtml, gecko) chrome/23.0.1271.97 safari/537.11"} }); casper.start('http://www.hotmail.com').then(function () { console.log('got here'); }); casper.wait(500, function () { console.log('wait'); }); casper.then(function(){ this.sendkeys("[name='loginfmt']", 'peterwhite12345678@outlook.com'); this.sendkeys("[name='passwd']", '12345678peterwhite'); this.click("[type='submit']"); console.log('entering log in information'); }); casper.wait(5000, function () { console.log('wait'); }); casper.then(function (){ console.log('printscreen'); casper.capture('there_is_nothing_by_the_right_side.png') }); casper.run();
i have tried
casperjs --ssl-protocol=any outlook.js
should maybe add path/plugin support casperjs?
try below code. need give/provide enough time open web page
var casper = require('casper').create({ // verbose: true, // loglevel: "info", viewportsize: {width: 1280, height: 720}, pagesettings: {useragent: "mozilla/5.0 (macintosh; intel mac os x 10_8_2) applewebkit/537.11 (khtml, gecko) chrome/23.0.1271.97 safari/537.11"} }); casper.start('http://www.hotmail.com').then(function () { console.log('got here'); }); casper.wait(1000, function () { console.log('wait'); }); casper.then(function () { this.sendkeys("[name='loginfmt']", 'peterwhite12345678@outlook.com'); this.sendkeys("[name='passwd']", '12345678peterwhite'); this.click("[type='submit']"); console.log('entering log in information'); }); casper.wait(20000, function () { this.waitforselector('#o365_mainlink_settings', function () { this.test.assertexists('#o365_lync_buttonid', 'lync icon visble, hence confirmed page opened completely'); }); }); casper.waitforselector(('._rp_52 > div:nth-child(4)'), function () { if (this.visible("button._rp_o1:nth-child(2)")) { console.log("here go, right side visible"); casper.capture('there something.png'); } else { console.log("nope") } }); casper.run();
Comments
Post a Comment