Answer the question
In order to leave comments, you need to log in
How to pass a variable to page.evaluate?
An example that works:
five = 5
page.evaluate(function(val) {
return val;
},five).then(function(num){
console.log(num)
});
five = 5
page.evaluate(test(five),five).then(function(num){
console.log(num)
});
function test(num) {
return num;
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question