From: w_a_x_man@... Date: 2009-02-12T05:38:48+09:00 Subject: Re: regexp problem On Feb 11, 11:01 am, Mark Thomas wrote: > As long as we're being pedagogical, I prefer XPath to all the previous > posted solutions. > > * More accommodating to minor changes in the HTML > * Very short (one-liner) and easy to read (IMHO) > > require 'nokogiri' > doc = Nokogiri::HTML(html) > > puts doc.xpath('//td[contains(.,"Traffic left")]/following- > sibling::td//script').to_s.scan(/Math.ceil.-(\d*)/) What if the cell contains "No Traffic left"?