title: Puppeteer - Click on button by class name?
body: <p><s> A. Consistency is all over the place; running !headless, I watch it sometimes work, sometimes it doesn't (like types in wrong data), it's really 50/50. How can my code be optimized for 100% reliability? </s><br>
  <strong>Update:</strong>
  Fixed inconsistencies by implementing a promise delay function &amp; delaying actions. </p>
  
  <p>How can I click on a button that is not a submit type nor has a name nor id? </p>
  
  <pre><code>&lt;button class="sb-frap" data-e2e="sendGift"&gt;Send gift&lt;/button&gt;
  </code></pre>
  
  <p>JS Path: </p>
  
  <pre><code>document.querySelector("#js-content &gt; div &gt; div:nth-child(6) &gt; span &gt; div &gt; div.absolute.bg-white.overflow-auto.content___2_l5Q &gt; div &gt; div &gt; div &gt; div &gt; div.invisible.base___3dWsJ.alwaysRelative___3FHV5 &gt; div &gt; span &gt; div &gt; button")
  </code></pre>
  
  <pre><code>await Promise.all([
   await page.waitForSelector(".sb-frap"),
   await page.click('button[class=".sb-frap"]'),
    ]);
  })();
  </code></pre>
  
  <p>Any help will greatly appreciated!</p>