Skip to content
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

pptr.dev elementHandle.$ API example throws Error: Node is either not visible or not an HTMLElement #4150

Closed
jbeacher6 opened this issue Mar 10, 2019 · 0 comments

Comments

@jbeacher6
Copy link

jbeacher6 commented Mar 10, 2019

Steps to reproduce

Tell us about your environment:

  • Puppeteer version: 1.13.0
  • Platform / OS version: Ubuntu 18.04.2 LTS
  • URLs (if applicable): https://google.com
  • Node.js version: v8.10.0

What steps will reproduce the problem?
Run the first example code at this link: https://pptr.dev/#?product=Puppeteer&version=v1.13.0&show=api-elementhandleselector

const puppeteer = require('puppeteer');

puppeteer.launch().then(async browser => {
  const page = await browser.newPage();
  await page.goto('https://google.com');
  const inputElement = await page.$('input[type=submit]');
  await inputElement.click();
  // ...
});
  1. save above code as elementHandleExample.js
yarn add puppeteer
node elementHandleExample.js

What is the expected result?
4. I do not receive an error from production example API code.

What happens instead?
5. I receive an error from production example API code:

UnhandledPromiseRejectionWarning: Error: Node is either not visible or not an HTMLElement

The same error also shows when I run this code at https://try-puppeteer.appspot.com/

const browser = await puppeteer.launch();
const page = await browser.newPage();
await page.goto('https://google.com');
const inputElement = await page.$('input[type=submit]');
await inputElement.click();
Error running your code. Error: Node is either not visible or not an HTMLElement
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant