Skip to content

Instantly share code, notes, and snippets.

@dmitriy-sqrt
Created November 17, 2014 13:33
Show Gist options
  • Save dmitriy-sqrt/f68b62331d3699abf05f to your computer and use it in GitHub Desktop.
Save dmitriy-sqrt/f68b62331d3699abf05f to your computer and use it in GitHub Desktop.
require 'nokogiri'
file = File.open("/home/neox/Desktop/test")
doc = Nokogiri::HTML(file)
rows = doc.css('tbody tr')
rows.each do |row|
name = row.at_xpath('td[2]/a/text()').to_s.strip
description = row.at_xpath('td[3]//text()').to_s.gsub(/\s+/, ' ').strip
description = 'Deprecated.' if description == ''
#unless name.include? "BIND_"
#puts "'#{name}' => \"#{description}\","
#end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment