-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
page.evaluate cloud not get any result #153
Comments
PhantomJS does not support ES6 syntax. In the examples above, you use |
page.evaluate(function () {
return [1, 2, 3].map(x => x + 1);
}) yes, i tried this get page.evaluate(function () {
return [].slice.call(document.querySelectorAll('tr')).slice(5, document.querySelectorAll('tr').length - 3);
}, (err4, result) => {
console.log(result);
browser.exit();
});
|
page.evaluate(function () {
return [1, 2, 3].map(x => x + 1);
}) This will not work in PhantomJS as you are using ES6 syntax. Arrow functions The correct syntax would be: page.evaluate(function () {
return [1, 2, 3].map(function(x) { return x + 1});
}); The other example of yours, with Keep this in mind when using The function you are sending into the function will be turned into a string and then executed with |
if i use:
can print html result.
using basic example:
The text was updated successfully, but these errors were encountered: