title: Nested each loop selections with Cheerio
body: <p>I'm trying to do a nested each loop with Cheerio, selecting my Cheerio selection twice. I've written my code this way because I want to iterate on the number of parent selections, while making a secondary selection.</p>
  
  <p>My second each loop does not find any elements. I've also tried creating a new cheerio <code>$$</code> constructor and feeding the html into it, but that fails as well.</p>
  
  <pre><code>$(selector1).each(function (i, el) {
      j++;
      // logging html is showing several p elements
      console.log($(this).html());
      $(this).find('p').each((k, elem) =&gt; {
        // but this loop is not finding any elements
        // $(elem).text() returns null
      });
    });
  </code></pre>