title: Node.js puppeteer - How to fetch only certain (filter) records from a table
body: <p>I'm using node.js and puppeteer to get some data. From the targeted table I only want to fetch certain records though .... . More specific, records with innerText: 'file. ........ .idx'.</p>
  
  <p>The below shows my query:</p>
  
  <pre><code>const tableRows = await page.$$('table &gt; tbody tr');
  console.log(tableRows.length);
  
  let tableCell01;
  let tableCell01Val;
  
  for (let i=1; i &lt; tableRows.length; i++){
  
    tableRow = tableRows[i];
    tableCell01 = await tableRow.$('td:nth-child(1) a');
    tableCell01Val = await page.evaluate( tableCell01 =&gt; tableCell01.href, tableCell01 );
  
    console.log('\n');
    console.log(tableCell01Val);
  
  }  
  </code></pre>
  
  <p>And here the output without the filtering is: </p>
  
  <p>Console:</p>
  
  <pre><code>6
  
  file.20180702.idx
  file.20180703.idx
  file.20180705.idx
  sitemap.20180702.xml
  sitemap.20180703.xml
  sitemap.20180705.xml
  </code></pre>
  
  <p>So the desired result should be:</p>
  
  <p>Console:</p>
  
  <pre><code>3
  
  file.20180702.idx
  file.20180703.idx
  file.20180705.idx
  </code></pre>
  
  <p>What's the best way to do this? Best would be to filter already before the loop ... to also get the correct tableRows.length</p>