Mechanize/Nokogiri from file

i’m playing with Mechanize and Nokogiri, and am have a problem which i
think is fairly basic, but can’t find a way around…

i want to be able to serialize/save pages which i am working on in
Mechanize to file, and load them up later on. i can save them easily
enough using WWW::Mechanize::Page’s (which i get returned from the
WWW::Mechanize::get()) save_as() method, and can see the webpage in the
file, but i can’t seem to load it back in to a WWW::Mechanize::Page
object later on. i’ve tried using get() and get_file() methods with
File objects and URI’s (ie. ‘file://…’), but get 400 responses, or ‘no
file exists’ errors. what am i missing out?

i just want to be able to load the page from file, and parse/work with
it using WWW::Mechanize::Page’s links(), forms(), etc. methods.


This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs