title: Why I got document is not defined error in puppeteer?
body: <p>I'd like to simulate a click on a gallery (<code>&lt;div class="image"&gt;</code>) but when I try to run this code, I got document not defined error. </p>
  
  <pre><code>async function gallery(page) {
   await page.waitFor(3000);
   await page.click(document.querySelector('.div image'));
  }
  </code></pre>
  
  <p>What's the problem here? How can I use document.querySelector correctly with puppeteer?</p>