question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

page.evaluate problem

See original GitHub issue

In official documentation api we can see: var title = page.evaluate(function(s) { return document.querySelector(s).innerText; }, 'title'); http://phantomjs.org/api/webpage/method/evaluate.html

  1. This code is not working here. Function .evaluate requires callback when we write argument ‘title’.
  2. And page.evaluate always return undefined.

Can you fix this?

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Reactions:1
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
puzrincommented, Oct 25, 2015

Works as intended. See https://github.com/baudehlo/node-phantom-simple#usage start & known issues in readme.

0reactions
puzrincommented, Jul 28, 2016

That’s a low-level driver, not framework. It does only [most of] things allowed by phantom, with same [very similar] signatures. Additional sugar should be implemented outside.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Puppeteer page.evaluate not working as expected
I have a console log before I run page.evaluate() which logs what I expect, but the console log inside page.evaluate never runs. const...
Read more >
Console.log() from page.evaluate() not working #1944 - GitHub
Hello, I'm trying to console.log() in a page.evaluate() function and it's not working... Any solutions ? Thank you !
Read more >
Page.evaluate() method - Puppeteer
Page.evaluate() method. Evaluates a function in the page's context and returns the result. If the function passed to page.evaluateHandle returns a Promise, ...
Read more >
Variable not defined with page.evaluate in Puppeteer - YouTube
... this when you hit this error : "Variable not defined with page. evaluate in Puppeteer" "How to pass variable into Puppeteer page....
Read more >
puppeteer.Page.evaluate JavaScript and Node.js ... - Tabnine
Show more. Evaluates a function in the browser context. If the function, passed to the frame. evaluate, returns a Promise, then frame.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found