html 页面代码
<input id="featured_item_id" type="hidden" value="37545306978">
代码
def self.get_uri(product_id)
url = "http://zpzk100.com/details/#{product_id}"
resp = RestClient.get("http://zpzk100.com/details/#{product_id}")
html = Nokogiri::HTML(resp)
href = html.css('.goto').attr('href').text
uri = URI.parse(URI.encode(href.strip))
resp = RestClient.get(uri)
html = Nokogiri::HTML(resp)
#获取input值
html.at('input#featured_item_id').map{|node| node["value"]}
end