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.

'Error: Node is either not visible or not an HTMLElement' is occurred when I execute Puppeteer 1.5.0-next on Chrome browser

See original GitHub issue

Steps to reproduce

ElementHandle.click method is throwing an error when I use Chrome. Here is the code snippet for reproducing and the result of executing it.

import puppeteer from "puppeteer";
import util from "util";

(async () => {
    const browser = await puppeteer.launch({
        headless: false,
        sloMo: 500,
        executablePath:
            "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"
    });
    const page = await browser.newPage();
    await page.goto("https://example.com", { waitUntil: "load" });
    await page.waitFor("body > div > p:nth-child(3) > a");
    const link = await page.$("body > div > p:nth-child(3) > a");
    console.log(`Link element: ${util.inspect(link)}`);
    await link.click();
})();
(node:13359) UnhandledPromiseRejectionWarning: Error: Node is either not visible or not an HTMLElement
    at ElementHandle._clickablePoint (.../node_modules/puppeteer/lib/ElementHandle.js:86:13)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:118:7)
(node:13359) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:13359) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Tell us about your environment:

  • Puppeteer version: 1.5.0-next.1530333501924
  • Platform / OS version: Mac OSX 10.12.6
  • Chrome version: Version 67.0.3396.99 (Official Build) (64-bit)
  • URLs (if applicable):
  • Node.js version: v9.7.1

I’m using the latest next tagged version of Puppeteer to avoid a bug discussed in #1325.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

5reactions
oliviertassinaricommented, Jul 23, 2018

I was facing the same problem. Using the “right” version of Chrome fixed the issue.

2reactions
ratkorlecommented, Nov 20, 2018

I was having the same problem when running my function on AWS-Lambda bu this happens to be best way to do it: const link = await page.$("body > div > p:nth-child(3) > a"); try { await page.evaluate((el) => { return el.click() }, link); await page.waitFor(1500); } catch (e) { console.log(e); }

Read more comments on GitHub >

github_iconTop Results From Across the Web

Puppeteer in NodeJS reports 'Error: Node is either not visible ...
click(); // Error: Node is either not visible or not an HTMLElement })();. I'm trying to emulate the behaviour of a real user...
Read more >
'Error: Node is either not visible or not an HTMLElement' is ...
'Error: Node is either not visible or not an HTMLElement' is occurred when I execute Puppeteer 1.5.0-next on Chrome browser.
Read more >
Resolve CloudWatch canary error "Node is either not visible ...
Resolution. When creating a CloudWatch canary, the "Node is either not visible or not an HTMLElement" error is typically caused by: Using ...
Read more >
Node is either not visible or not an HTMLElement (flaky ...
I don't think we have time to investigate this so probably best to just skip this test unless QTE have any ideas why...
Read more >
Puppeteer NPM - npm.io
Puppeteer is a Node library which provides a high-level API to control Chrome or Chromium over the DevTools Protocol. Puppeteer runs headless by...
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