-
-
Save ecin/2473860 to your computer and use it in GitHub Desktop.
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); | |
} | |
}); |
Hi All,
Check my repo for the same.
https://github.com/manishjo/Automation/blob/master/facebook_automation/fbScreenshot.js
Its works fine and login's to facebook and takes a snapshot of your home page.
Thanks,
Manish Joshi
Here is a good post explaining how to login to the Facebook and get all images greater than 100x100 pixels from the timeline: http://code-epicenter.com/how-to-login-to-facebook-using-casperjs/
It's not working. It's not working. It's not working. It's not working. It's not working. It's not working. It's not working. It's not working. It's not working. It's not working. It's not working. It's not working. It's not working.
^ Are you kidding me dude?
For all those who can't login, or don't get any of content,
use this command phantomjs --ssl-protocol=any myscript
edit "u_0_1"
to "loginbutton"
Worked fine for me, but no pictures showed. Is there a way of grabbing the pictures too using PhantomJS?
document.querySelector("input[name='email']").value = "email";
document.querySelector("input[name='pass']").value = "pass";
document.getElementById("u_0_1").click();
type error araha hai null is not an object
And it seems like I can evaluate twice. Below are the output:
CONSOLE: hello (from line #undefined in "undefined")
CONSOLE: haha (from line #undefined in "undefined")
My phantomjs version is 1.9.7