Skip to content

Instantly share code, notes, and snippets.

@abbood
Created April 9, 2013 16:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save abbood/5347287 to your computer and use it in GitHub Desktop.
Save abbood/5347287 to your computer and use it in GitHub Desktop.
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);
});
@abbood
Copy link
Author

abbood commented Apr 9, 2013

this demonstrates that session is persisted across casperjs session

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment