# Mechanize/Nokogiri from file

**URL:** <https://www.ruby-forum.com/t/mechanize-nokogiri-from-file/175589>\
**Category:** Ruby\
**Created:** [September 16, 2009, 4:25am UTC](https://www.ruby-forum.com/t/mechanize-nokogiri-from-file/175589 "2009-09-16T04:25:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![rowanu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/58f4c7/32.png) [@rowanu](https://www.ruby-forum.com/u/rowanu)\
**Post date:** [September 16, 2009, 4:25am UTC](https://www.ruby-forum.com/t/mechanize-nokogiri-from-file/175589/1 "2009-09-16T04:25:51Z")

</div>

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.

cheers.
