The idea is that since Mechanize apparently uses Hpricot and it's
surely
using it to parse the HTML begotten from the agent.get method, it would
be
nice if I didn’t have to repeat that work.
Is there a way to get this Hpricot document? …or am I just totally
wrong about how Mechanize uses Hpricot?
Thank you…
On Sun, Sep 14, 2008 at 04:03:04AM +0900, Just Another Victim of the
Ambient M. wrote:
I would like to do this
doc = page.get_hpricot_dom
The idea is that since Mechanize apparently uses Hpricot and it's surely
using it to parse the HTML begotten from the agent.get method, it would be
nice if I didn’t have to repeat that work.
Is there a way to get this Hpricot document? …or am I just totally
wrong about how Mechanize uses Hpricot?
You can get at the Hpricot document by using the “parser” accessor on
WWW::Mechanize::Page. Page also responds to “search”, “/”, and “at”,
which just delegate to the Hpricot document.