Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require 'nokogiri'
- page = Nokogiri::HTML(open("dn.html"))
- td = page.xpath('/html/body/div[1]/table[6]//tr[2]//td')
- text_content = td.text.delete("\n").delete("\r")
- regex = /([\w-]{9})(.*)Pot\. Poluidor.*Geral:(.*)Porte:(.*): Pequeno(.*): Médio(.*): Grande/
- match = text_content.match(regex)
- text = match[6]
- text.chars.each do |x|
- p x + " - " + x.ord.to_s + " - " + (x.ord == [160].pack('U')).to_s
- end
- # OUTPUT
- # "n - 110 - false"
- # "o - 111 - false"
- # " - 160 - false"
- # " - 160 - false"
- # " - 32 - false"
Advertisement
Add Comment
Please, Sign In to add comment