title: lxml iterate through child divs
body: <p>I have the below html code where i parse ratings/text etc.
  How can I iterate through all divs class contain "posting item" below the div "wrap" using lxml and tree?</p>
  
  <p>With the below I get all post divs selected at the same time, </p>
  
  <pre><code>forumposts = tree.xpath("//div[@class='wrap']//div[contains(@class, 'posting item')]")
  
  # here i want to iterate through posting items 
  # so i should have 1 text/rating to process in the parse function
  for post in forumposts:
     parse(post)
  </code></pre>
  
  <p>The HTML:</p>
  
  <pre><code>&lt;div class="wrap"&gt;
  &lt;div class="posting item theme-international" data-postingid="1035091361"&gt;
      &lt;div class="thread"&gt;
          &lt;div class="js-ratings ratings"&gt;
              &lt;div class="js-ratings-counts ratings-counts" data-closable- 
      target="ratinglog-1-1035091361" 
  onclick="ForumLoader.toggleRatinglog(1035091361, 1)"&gt;
  &lt;span class="js-ratings-negative-count ratings-negative-
  count"&gt;6&lt;/span&gt;
  &lt;span class="js-ratings-positive-count ratings-positive-
  count"&gt;7&lt;/span&gt;
              &lt;/div&gt;
          &lt;/div&gt;
          &lt;div class="text"&gt;
              &lt;a href="xyz" rel="nofollow"&gt;
                  &lt;strong/&gt;
                  &lt;span&gt;Posting text 1 &lt;/span&gt;
              &lt;/a&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  
  &lt;div class="posting item theme-international" data-postingid="1035091361"&gt;
      &lt;div class="thread"&gt;
          &lt;div class="js-ratings ratings"&gt;
              &lt;div class="js-ratings-counts ratings-counts" data-closable-
  target="ratinglog-1-1035091361" 
  onclick="ForumLoader.toggleRatinglog(1035091361, 
  1)"&gt;
                  &lt;span class="js-ratings-negative-count ratings-negative-
  count"&gt;1&lt;/span&gt;
                  &lt;span class="js-ratings-positive-count ratings-positive- 
  count"&gt;11&lt;/span&gt;
              &lt;/div&gt;
          &lt;/div&gt;
          &lt;div class="text"&gt;
              &lt;a href="xyz" rel="nofollow"&gt;
                  &lt;strong/&gt;
                  &lt;span&gt;Posting text 2&lt;/span&gt;
              &lt;/a&gt;
          &lt;/div&gt;
      &lt;/div&gt;
   &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>