Cannot use `getEvenetListeners` in page.evaluate()
See original GitHub issueSteps to reproduce
Tell us about your environment:
- Puppeteer version:1.10.0
- Platform / OS version:MacOS
- URLs (if applicable):
- Node.js version:11.3
What steps will reproduce the problem?
Please include code that reproduces the issue.
- Using getEventListeners in
page.evaluate
- I get this error message
(node:53503) UnhandledPromiseRejectionWarning: Error: Evaluation failed: ReferenceError: getEventListeners is not defined
- I thought getEventListeners is not the window / document property, could I enable something ( maybe DOMDebugger option? ) to make this property work?
- Or … Is there another way to debug document if elements attach some unexpected event type / event listener?
What is the expected result?
Get event listeners array.
What happens instead?
error message Error: Evaluation failed: ReferenceError: getEventListeners is not defined
related issue: https://github.com/GoogleChrome/puppeteer/issues/3349 https://github.com/GoogleChrome/puppeteer/issues/3166 https://github.com/GoogleChrome/puppeteer/issues/1919
Issue Analytics
- State:
- Created 5 years ago
- Comments:8 (3 by maintainers)
Top Results From Across the Web
getEventListeners is not defined in PuppeteerSharp
How to use getEventListeners within puppeteerSharp? I found this for javascript: const cdp = await page.target().createCDPSession(); const ...
Read more >puppeteer document is not defined - You.com | The AI Search ...
I was transforming my code with babel. Puppeteer page.evaluate calls autoScroll.toString() which results in an incomplete string when used with babel. Instead ...
Read more >Variable not defined with page.evaluate in Puppeteer - YouTube
The 4 BEST Places to Get Contact Information · Web scraping with Javascript using Puppeteer and Node.js · The Only Puppeteer Tutorial You'll...
Read more >Console tool utility functions and selectors - Microsoft Learn
Right-click the returned result and then select Reveal in Elements Panel to find it in the DOM, or Scroll in to View to...
Read more >Node.js v19.3.0 Documentation
triggerAsyncId(); Using AsyncResource for a Worker thread pool ... CORS is never checked on the destination server; Cannot load non-network dependencies ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
For the hackers out there: you can get classes now from
puppeteer/lib/api
:In puppeteer@1.13, we could not import (require)
ElementHandle
fromExecutionContext
, I just replaceElementHandle
withJSHandle
, I am not sure this a good alternative solution.Workaround for who need this method in the latest version.