Having trouble getting my function to return data correctly. I am trying to retrieve the value of this input box.
<input type="text" value="<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="0b6e736a667b6764646025686466">[email protected]</a>" maxlength="100" size="40" name="mail"></input>
So, I created a function like this:
exports.Details = function() {
casper.thenOpen("https://perfectmoney.is/settings.html", function() {
var fetch = casper.fetchText('#reg > table:nth-child(3) > tbody:nth-child(1) > tr:nth-child(1) > td:nth-child(1) > table:nth-child(4) > tbody:nth-child(1) > tr:nth-child(8) > td:nth-child(2) > input:nth-child(1)')
});
};
Then, I am calling my function like this:
casper.then(function() {
var item = pief.Details();
console.log(item);
});
I am receiving an undefined result. How can I resolve this?