title: cheerio / jquery selectors: how to get a list of elements in nested div's?
body: <p>I need to parse some markup similar to this one, from an html page:</p>
  
  <pre><code>&lt;div id="list"&gt;
  
    &lt;div class="item-level-a"&gt;
      &lt;div class="item-level-b"&gt;
        &lt;a href="http://www.example.com/1"&gt;&lt;/a&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  
    &lt;div class="item-level-a"&gt;
      &lt;div class="item-level-b"&gt;
        &lt;a href="http://www.example.com/2"&gt;&lt;/a&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  
    &lt;div class="item-level-a"&gt;
      &lt;div class="item-level-b"&gt;
        &lt;a href="http://www.example.com/3"&gt;&lt;/a&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  
  &lt;/div&gt;
  </code></pre>
  
  <p>I did try with this code:</p>
  
  <pre><code>$list = [];
  $('div[id="list"]').each(function() {
    var href = $(this).find('div &gt; div &gt; a').attribs('href');
    list.push(href);
  });
  </code></pre>
  
  <p>without success: error was:</p>
  
  <pre><code>TypeError: Object &lt;a href="http://www.example.com/1"&gt;&lt;/a&gt;
                    &lt;a href="http://www.example.com/2"&gt;&lt;/a&gt;
                    &lt;a href="http://www.example.com/3"&gt;&lt;/a&gt;
  has no method 'attribs'
  </code></pre>
  
  <p>:-(.</p>
  
  <p>Any clue?</p>