I done it by splitting my html source with the method split(“”) and
use regexp to extract what I want. But this solution do not satisfied
me. It’s unmaintanable.
However, I’m pretty sure that I could do more clever code…
Is there anyone has an idea, a clue a thought ?
Use a real parser. Example:
#—
require ‘nokogiri’
html = <<eohtml
One
Two
Three
eohtml
doc = Nokogiri::HTML(html)
doc.search(‘//tr’).each do |line|
puts line.search(‘td/text()’)
end