page.open("http://www.google.com", function () {
var text = page.evaluate(function (selector) {
return document.querySelector(selector).innerText;
}, selector);
// resolve the promise and pass 'text' back to node
resolve(text);
});
Returns: The element contains the following text: null
Why?
As in the example:
Returns: The element contains the following text: null Why?