title: Click visible elements using puppeteer
body: <p>I am trying to click a number of elements in in a page, but only if they are visible. This was quite easy using selenium (using <code>is_displayed</code>), but I can't seem to find a way in puppeteer.
  I was trying to use something like</p>
  
  <pre><code>try {
      await page
        .waitForSelector(id, visible=true, timeout=0)
        .then(() =&gt; {
          element.click()
        });
  ...
  </code></pre>
  
  <p>But this does not working if it is a simple element like :</p>
  
  <pre><code>&lt;a class="cookie-close" href="#"&gt;
  OK
  &lt;/a&gt;
  </code></pre>
  
  <p>I also can't seem to see a way to do it using the <code>element.click</code> method in puppeteer.</p>