This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (
This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (
Home
Welcome to the mechanize wiki!
Using Nokogiri instead of Hpricot
Mechanize will be changing its HTML parser from Hpricot to Nokogiri. You can check out how this will affect your current code now by setting the HTML parser on Mechanize. What will this parser buy you? A few important features:
Speed
Nokogiri uses libxml to parse HTML and is much faster than Hpricot.
Better HTML recovery
Nokogiri handles broken HTML better than Hpricot.
XPath and CSS searching
Nokogiri correctly implements XPath queries and will even let you find by CSS selectors. You can use selectors straight from Firebug or even your CSS files to find elements in your HTML.
You can help by making the switch early and reporting any bugs you find.
How to make the switch early
First install nokogiri.
Then set the HTML parser to Nokogiri, and use Mechanize as normal:
require 'rubygems'
require 'nokogiri'
require 'mechanize'
WWW::Mechanize.html_parser = Nokogiri::HTML
agent = WWW::Mechanize.new
agent.get('http://google.com/').links.each do |link|
p link
end







