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.click not working

See original GitHub issue

Steps to reproduce

Tell us about your environment:

  • Puppeteer version: 1.17.0
  • Platform / OS version: Ubuntu 18.04
  • URLs (if applicable):
  • Node.js version: v11.10.0

wait page.click(‘#link’) works most of the time. But for some mysterious reason, sometimes it is not. The worst is that the program is doing exactly the same, but just on a different page with the exactly same layout.

But await page.$eval(‘#link’, elem => elem.click()); works really well.

  await page.hover('#link');
  page.click(''#link'); // --> not always working
  page.$eval('#link', elem => elem.click()); // --> always works

What is the expected result? page.click(''#link') and page.$eval('#link', elem => elem.click()) should work the same way.

It is hard for me to give you a code reproducing the issue because it is happening on an online web service needing credentials to log in.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:9
  • Comments:10

github_iconTop GitHub Comments

1reaction
vigneshveeran-adcommented, Jun 13, 2019

I am facing the same issue 😦 dont understand why. i had to use waitforSelector with a click after. page.$eval(cssQuery('action', 'someting'), el => el.click());

0reactions
stale[bot]commented, Jul 23, 2022

We are closing this issue. If the issue still persists in the latest version of Puppeteer, please reopen the issue and update the description. We will try our best to accomodate it!

Read more comments on GitHub >

github_iconTop Results From Across the Web

7 solutions for page.click() is not working in puppeteer
1. Focus and Enter - First Focus on the element and then press enter. · 2. using $eval - you can try as...
Read more >
puppeteer element.click() not working and not throwing an error
I have determined what is happening, and why I don't get an error, and how to work around the issue. The main issue...
Read more >
Puppeteer Won't Click on Element · Issue #1805 - GitHub
Wondering why the plain page.click('selector') doesn't work? ... The problem noted was that simply using await page.click() was not working.
Read more >
Error - Click not executed | Checkly
For example: our Playwright script is supposed to run a page.click('#btn-login') but seems to ignore the click and just proceed with the next...
Read more >
Website Buttons Not Working In Browsers? Here Are 6 Fixes
1. Website buttons aren't working on Google Chrome · 1.1. Refresh the website page · 1.2. Turn on JavaScript · 1.3. Clear the...
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