Install
sudo gem install nokogiri
Contribute
github.com/tenderlove/nokogiri

An HTML, XML, SAX, & Reader parser with the ability to search documents via XPath or CSS3 selectors… and much more

Nokogiri

Module Nokogiri::CSS

Public Class Methods

parse(selector) Show Source
 

Parse this CSS selector in selector. Returns an AST.

# File lib/nokogiri/css.rb, line 14 14: def parse selector 15: Parser.new.parse selector 16: end
xpath_for(selector, options={}) Show Source
 

Get the XPath for selector.

# File lib/nokogiri/css.rb, line 20 20: def xpath_for selector, options={} 21: Parser.new(options[:ns] || {}).xpath_for selector, options 22: end