-
-
Save xemoe/c0e263f9c6cb75e9b11275c002f84397 to your computer and use it in GitHub Desktop.
Log into Facebook with phantomJS
This file contains hidden or 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
console.log("got here"); | |
var page = require('webpage').create(); | |
page.onConsoleMessage = function(msg) { | |
console.log(msg); | |
}; | |
page.open("http://facebook.com", function(status) { | |
if ( status === "success" ) { | |
page.evaluate(function() { | |
document.querySelector("input[name='email']").value = "email"; | |
document.querySelector("input[name='pass']").value = "pass"; | |
document.querySelector("#login_form").submit(); | |
console.log("Login submitted!"); | |
}); | |
window.setTimeout(function () { | |
page.render('colorwheel.png'); | |
phantom.exit(); | |
}, 5000); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment