2
I’m creating a script that picks up links from a website on phantomjs. My idea is to store in a vector the link with his innerHTMl and then I need to modify the link, but when I will modify later I can’t.
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;