casper.thenEvaluate(function(text){
document.querySelector("#inputValue").value=text
})
casper.thenEvaluate seems to not accept the argument and it is filling undefined in the webpage.
casper.thenEvaluate(function(text){
document.querySelector("#inputValue").value=text
})
casper.thenEvaluate seems to not accept the argument and it is filling undefined in the webpage.
Mario Nikolaus
On
Since evaluate runs in browser context(instead of Casper one) you have to explicitly provide variables after the callback function definition. Please check example from the docs
casper.evaluate(function(username, password) {
document.querySelector('#username').value = username;
document.querySelector('#password').value = password;
document.querySelector('#submit').click();
}, 'sheldon.cooper', 'b4z1ng4');
Note that username param in callback corresponds to sheldon.cooper and password param corresponds to b4z1ng4.
Copyright © 2021 Jogjafile Inc.
According to the documentations you should use "thenEvaluate" after "start" like this:
source: