title: Wait for an xpath in Puppeteer
body: <p>On a page I'm scraping with Puppeteer, I have a list with the same id for every <code>li</code>. I am trying to find and click on an element with specific text within this list. I have the following code:</p>
  <pre class="lang-js prettyprint-override"><code>await page.waitFor(5000)
  
  const linkEx = await page.$x(&quot;//a[contains(text(), 'Shop')]&quot;)
  
  if (linkEx.length &gt; 0) {
    await linkEx[0].click()
  }
  </code></pre>
  <p>Do you have any idea how I could replace the first line with waiting for the actual text <code>'Shop'</code>?</p>
  <p>I tried await <code>page.waitFor(linkEx)</code>, <code>waitForSelector(linkEx)</code> but it's not working.</p>
  <p>Also, I would like to replace that <code>a</code> in the second line of code with the actual id (<code>#activities</code>) or something like that but I couldn't find a proper example.</p>
  <p>Could you please help me with this issue?</p>