From: Steel Steel Date: 2010-10-06T10:33:39+09:00 Subject: Re: How can I count number of elements in an HTML page > I can find the section I want with a regex but I don't know how to > iterate through the string looking for particular elements. I was > thinking about taking the section I'm interested in and saving it as > an array and then iterating through each array element (html line) > that way, but I thought there might be a quicker way to do it. $html.scan(%r{}m).to_s.scan(/
  • /).size -- Posted via http://www.ruby-forum.com/.