Skip to content

Instantly share code, notes, and snippets.

@theycallmeswift
Forked from i/gist:6851979
Created October 6, 2013 10:45
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save theycallmeswift/6852405 to your computer and use it in GitHub Desktop.
Save theycallmeswift/6852405 to your computer and use it in GitHub Desktop.
var casper = require('casper').create({
verbose: true,
logLevel: 'debug',
pageSettings: {
userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5) AppleWebKit/537.4 (KHTML, like Gecko) Chrome/22.0.1229.94 Safari/537.4'
}
});
var url = 'https://www.pinterest.com/login/';
casper.start(url, function() {
// search for 'casperjs' from google form
console.log("page loaded");
this.fill('.loginForm', {
username_or_email: 'mitpindb@gmail.com',
password: 'passwordy'
});
casper.thenClick('.formFooterButtons button');
casper.waitForUrl(/http:\/\/www\.pinterest\.com\/$/, function(){
console.log("Page Title " + document.title);
casper.debugHTML('.profileName');
});
});
casper.run();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment