At last... I made a PhantomJS script which exactly does what I need...
It allows to login to a site and then executes the javascripts to show content.
Additionally I added a command to generate a screenshot of the website to make it easier to debug.
Thanks to RolandKrüger and remy which are helped to get a solution.
One may have to change the script a little bit but I think it can help ;)
var page = require('webpage').create();
page.onConsoleMessage = function(msg) {
console.log(msg);
};
page.open("http://www.somewebsite.com", function(status) {
if ( status === "success" ) {
page.evaluate(function() {
document.querySelector("input[name='MAIL_ADDRESS']").value = "mymail@gmail.com";
document.querySelector("input[name='PASSWORD']").value = "mypassword";
document.getElementsByName("LOGIN_FORM_SUBMIT")[0].click();
console.log("Login submitted!");
});
window.setTimeout(function () {
page.render('screenshot.png');
var ua = page.evaluate(function () {
return document.getElementById('AnElementIdOnMyWebsite').innerText;
});
console.log(ua);
phantom.exit();
}, 5000);
}
});