title: Puppeteer in NodeJS reports 'Error: Node is either not visible or not an HTMLElement'
body: <p>I'm using 'puppeteer' for NodeJS to test a specific website.  It seems to work fine in most case, but some places it reports:</p>
  <blockquote>
  <p>Error: Node is either not visible or not an HTMLElement</p>
  </blockquote>
  <p>The following code picks a link that in both cases is off the screen.</p>
  <p>The first link works fine, while the second link fails.</p>
  <p>What is the difference?
  Both links are off the screen.</p>
  <p>Any help appreciated,
  Cheers, :)</p>
  <h3>Example code</h3>
  <pre><code>const puppeteer = require('puppeteer');
  
  const initialPage = 'https://website.com/path';
  const selectors = [
      'div[id$=&quot;-bVMpYP&quot;] article a',
      'div[id$=&quot;-KcazEUq&quot;] article a'
  ];
  
  (async () =&gt; {
      let selector, handles, handle;
      const width=1024, height=1600;
      const browser = await puppeteer.launch({ 
          headless: false, 
          defaultViewport: { width, height } 
      });
      const page = await browser.newPage();
      await page.setViewport({ width, height});
      page.setUserAgent('UA-TEST');
  
      // Load first page
      let stat = await page.goto(initialPage, { waitUntil: 'domcontentloaded'});
  
      // Click on selector 1 - works ok
      selector = selectors[0];
      await page.waitForSelector(selector);
      handles = await page.$$(selector);
      handle = handles[12]
      console.log('Clicking on: ', await page.evaluate(el =&gt; el.href, handle));
      await handle.click();  // OK
      
      // Click that selector 2 - fails
      selector = selectors[1];
      await page.waitForSelector(selector);
      handles = await page.$$(selector);
      handle = handles[12]
      console.log('Clicking on: ', await page.evaluate(el =&gt; el.href, handle));
      await handle.click();  // Error: Node is either not visible or not an HTMLElement
  
  })();
  </code></pre>
  <p>I'm trying to emulate the behaviour of a real user clicking around the site, which is why I use <code>.click()</code>, and not <code>.goto()</code>, since the <code>a</code> tags have <code>onclick</code> events.</p>