I'm creating a script that takes links from a phantomjs site. My idea is to store in a vector the link with its innerHTMl and then I need to modify the link, but when I modify it later I can not.
My code:
var player = 0;
var links = page.evaluate(function() {
var a = document.querySelectorAll(".link[rel='nofollow']:not(#bg)");
for(var i =0; i < a.length; i++) {
array.push({
"html":a[i].innerHTML,
"link":a[i].href
}
);
}
return array;
});
//Valor não está sendo definido
links[player]["link"] = 1;