I can't pass arguments to function passed to page.evaluate
. I am trying to submit form.
data1 = "Textsample";
page.evaluate(function(data1) {
var form = document.getElementById ("MyForm");
form.data.value = data1;
form.submit();
});
But when I'am taking screenshot of page the data field is filled with "undefined". What am I doing wrong and how to fix it?
You need to pass it as 2nd arg in page.evaluate
.
page.evaluate(function(arg){},arg);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With