Created
April 9, 2013 16:42
-
-
Save abbood/5347287 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var content; | |
var casper = require('casper').create(); | |
function getContent() { | |
return document.querySelectorAll('html')[0].outerHTML; | |
} | |
casper.start('https:site/login.html', function() { | |
// search for 'casperjs' from google form | |
this.fill('form[method="post"]', { 'login': 'login', 'passwd': 'pwd' }, true); | |
}); | |
casper.then(function() { | |
// the content dumped here is from the page loaded for signed in users | |
// ie session is persisted | |
content = this.evaluate(getContent); | |
}); | |
casper.run(function() { | |
// echo results in some pretty fashion | |
this.echo('content' + content); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
this demonstrates that session is persisted across casperjs session