A Little Help with Hpricot Parsing

I need to scrape out the name, address, city, state, zip, etc. from site. Due to their wonderful coding, they didn't put lines of text in <p> tags. So Hpricot doesn't see the address (et al) as an element, but it does see the <br> as empty elements.

So how do I pick out the address and so forth if they are not in elements?

Here is what I have scraped so for, down to my target table: <table id="vbsSearch_pnlSortByOrg">   <tr>     <td>       <h3>         <span class="orgName">Bank of America</span>       </h3>       405 N. 3rd Street<br>       Phoenix, Arizona&nbsp;60606<br>       Distance: N/A<br>       800-555-1212<br>       <ul>         <li>           <strong>June 15 - 20 2008</strong><br>           6:00 PM&nbsp;-&nbsp;9:00 PM<br>           Event Theme Name<br>         </li>       </ul>       <hr align="left" width="100%">       <h3>         <span class="orgName">Washington Mutual</span>       </h3>       3705 Beaver Creek Rd<br>       Austin, Texas&nbsp;60606<br>       Distance: N/A<br>       800-555-1212<br>       <ul>         <li>           <strong>July 07 - 11 2008</strong><br>           9:00 AM&nbsp;-&nbsp;12:00 AM<br>           Event Theme Name<br>         </li>       </ul>       <hr align="left" width="100%">     </td>   </tr> </table>

So how do I pick out the address and so forth if they are not in elements?

Use that fact to your advantage. The only non-elements in the table cell are your addresses.

doc.search('/table/tr/td/*').each do |node|   print node unless node.elem? end

This will print out the addresses only.