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.value
end
使用Nokogiri获取页面Keywords
最新推荐文章于 2022-09-08 15:36:00 发布