title: Playwright - nested locator calls
body: <p>I have a structure like this I am trying to test:</p>
  <pre><code>&lt;div custom-id=a&gt;
    &lt;div custom-id=b&gt;
      &lt;h1&gt;one&lt;/h1&gt;
    &lt;/div&gt;
    &lt;div custom-id=b&gt;
      &lt;h1&gt;two&lt;/h1&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div custom-id=a&gt;
    &lt;div custom-id=b&gt;
      &lt;h1&gt;three&lt;/h1&gt;
    &lt;/div&gt;
    &lt;div custom-id=b&gt;
      &lt;h1&gt;four&lt;/h1&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  
  </code></pre>
  <p>I'd like to query it in two parts.  First, get back all the custom-id=a nodes, then for each of those, get back all the custom-id=b nodes.</p>
  <p>Based on previous questions I have asked, I was under the impression something like this would work:</p>
  <pre><code>const aNodes = await this.page.locator(&quot;custom-id=a&quot;);
  
  for (let aNode in aNodes) {
    const bNodes = await aNode.evaluate(node =&gt;
      Array.from(node.querySelectorAll('custom-id=&quot;b&quot;')));
  }
  </code></pre>
  <p>But when I try this, the IDE linter is telling me that aNode is a string.  I guess I expected that aNodes would be an array of something I could again query.</p>
  <p>My apologies if you have already answered questions from me along these lines.  I am struggling to grasp some basics here.</p>