我正在尝试从Nokogiri NodeSet中获取随机元素。
我已经尝试过
nodeset.sample(10)
where
nodeset = html_page.css('div')
但是这会导致错误#的未定义方法'sample'
阅读Nokogiri的rubydocs: