title: Watir: How to retrieve all HTML elements that match an attribute? (class, id, title, etc)
body: <p>I have a page that is dynamically created and displays a list of products with their prices. Since it's dynamic, the same code is reused to create each product's information, so they share the tags and same classes. For instance:</p>
  
  <pre><code>&lt;div class="product"&gt;
    &lt;div class="name"&gt;Product A&lt;/div&gt;
     &lt;div class="details"&gt;
      &lt;span class="description"&gt;Description A goes here...&lt;/span&gt;
      &lt;span class="price"&gt;$ 180.00&lt;/span&gt;
    &lt;/div&gt;
   &lt;/div&gt;
  
   &lt;div class="product"&gt;
     &lt;div class="name"&gt;Product B&lt;/div&gt;
      &lt;div class="details"&gt;
        &lt;span class="description"&gt;Description B goes here...&lt;/span&gt;
        &lt;span class="price"&gt;$ 43.50&lt;/span&gt;
     &lt;/div&gt;
    &lt;/div&gt;`
  
  &lt;div class="product"&gt;
   &lt;div class="name"&gt;Product C&lt;/div&gt;
    &lt;div class="details"&gt;
      &lt;span class="description"&gt;Description C goes here...&lt;/span&gt;
      &lt;span class="price"&gt;$ 51.85&lt;/span&gt;
   &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>And so on.</p>
  
  <p>What I need to do with Watir is recover all the texts inside the spans with class="price", in this example: $ 180.00, $43.50 and $51.85.</p>
  
  <p>I've been playing around with something like this:
      <code>@browser.span(:class, 'price').each do |row|</code> but is not working.</p>
  
  <p>I'm just starting to use loops in Watir. Your help is appreciated. Thank you!</p>