I have to run automated test using PhantomJS on the website LinkedIn, the test consists of logging into the website, going into your contacts and printing them all.
The problem is that once I enter my login info and submit the form, the loading page starts to load and doesn't go further than mid way because of an error ("Can't find variable : map").
I never use any variable named map so I don't understand what the problem is.
Here's my code :
var page = require('webpage').create();
function login(){
page.evaluate(function() {
document.querySelector("#session_key-login").value="my_login";
document.querySelector("#session_password-login").value="my_pass";
document.querySelector("#btn-primary").click();
});
}
page.open("https://www.linkedin.com/uas/login", function(status){
// page.settings.resourceTimeout = 10000;
console.log(page.title);
login();
setTimeout(function() {
console.log(page.title);
page.render("test.png");
phantom.exit();
}, 10000);
});
Thanks for reading.