运用Nokogiri获取页面Keywords

使用Nokogiri获取页面Keywordsrequire rubygemsrequire nokogiridoc Nokogiri::HTML(htmlheadm

使用Nokogiri获取页面Keywords

require 'rubygems'require 'nokogiri'doc =Nokogiri::HTML("<html><head><meta name="Keywords" content="one, two, three"></head><body></body></html>")doc.xpath("//meta[@name='Keywords']/@content").each do|attr|  puts attr.valueend