From: Safas Khkjh on
Hi,
I am looking at using the mechanize gem to parse HTML. The HTML has
already been downloaded by the spider gem. What I want to do is load the
HTML response from the spider into mechanize.

I've looked through mechanize's documentation and there is no mention of
using local files to parse. All of the examples use remote files.

Does any one know how I could do this?

Thank you,
RYan
--
Posted via http://www.ruby-forum.com/.

From: Sora Harakami on
On Jun 11, 2010, at 10:28 PM, Safas Khkjh <ryandewhurst(a)gmail.com> wrote:

> Hi,
> I am looking at using the mechanize gem to parse HTML. The HTML has
> already been downloaded by the spider gem. What I want to do is load the
> HTML response from the spider into mechanize.
>
> I've looked through mechanize's documentation and there is no mention of
> using local files to parse. All of the examples use remote files.
>
> Does any one know how I could do this?
>
> Thank you,
> RYan

Hi,

Mechanize is using "nokogiri" gem for parse html.
But "nokogiri" doesn't have like mechanize's cookie feature, etc.

Because mechanize emulates browser (like click link, cookies, referer, form..),
and nokogiri is only for parse some htmls (includes local file).

Please try "nokogiri" gem.

--
Sora Harakami (iPad) - @sora_h

From: Safas Khkjh on
Thanks Nokogiri looks like what I am looking for! :)
--
Posted via http://www.ruby-forum.com/.