Moving Mechanize to Nokogiri

P

Patrick L.

Hey guys,
I'm on the second iteration of an app I'm writing to scrape some data
from iStock and right now, I'm trying to force Mechanize to use
Nokogiri. I've gotten away with not having to for a while, but as I keep
adding to this app, it's inevitable.

This is what I thought worked (http://pastie.org/393471); namely, drop
the WWW::Mechanize.html_parser = Nokogiri::HTML inside the constructor.
But if I do that, it thinks all my Nokogiri functions don't exist (ie
it's still using hpricot).

Any clues?
 
P

Patrick L.

You know, I just realized that these error messages probably mean that
though the parser is Nokogiri, Mechanize pages cannot yet be treated
like Nokogiri objects.

Here are the bread crumbs I'm following:
- http://wiki.github.com/tenderlove/mechanize
- http://mechanize.rubyforge.org/mechanize/ (down at the bottom but
apparently the transition from hpricot is not yet implemented, even
though it says so)


Aaron Patterson Sat, 01 Nov 2008 10:41:39 PDT

"@Phoenix: Yes, it will be integrated with WWW::Mechanize. I am working
on the Hpricot deprecation roadmap now. I hope Nokogiri will be
integrated with Mechanize by version 1.0 (possibly around January, I’m
not sure)."

- http://tenderlovemaking.com/2008/10/30/nokogiri-is-released/
 
P

Patrick L.

Regardless, I'm still not sure how to deal with the situation I pastied
above. Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,011
Latest member
AjaUqq1950

Latest Threads

Top