How about this?

doc = Nokogiri::HTML(@my_text)

output = @date_string + $/
doc.xpath('//address/following-sibling::p//text()').each { |line| output 
<< ( line.text.strip + $/ ) }

File.write("snippet.txt", output)

-- 
Posted via http://www.ruby-forum.com/.