[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Moving Mechanize to Nokogiri

Patrick L.

2/19/2009 12:05:00 AM

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....); 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?
--
Posted via http://www.ruby-....

3 Answers

Patrick L.

2/19/2009 12:45:00 AM

0

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...
- http://mechanize.rubyforge.org/... (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...
--
Posted via http://www.ruby-....

Patrick L.

2/19/2009 12:46:00 AM

0

Regardless, I'm still not sure how to deal with the situation I pastied
above. Thanks.
--
Posted via http://www.ruby-....

Ryan Davis

2/19/2009 5:11:00 AM

0


On Feb 18, 2009, at 16:05 , Patrick L. wrote:

> Any clues?

wait