Search code examples
rubymechanize-ruby

Anyone know of a caching plugin for Ruby Mechanize?


I have a Mechanize based Ruby script to scrape a website. I am hoping to speed it up by caching the downloaded HTML pages locally to make the whole "tweak output -> run -> tweak output" cycle quicker. I would prefer not to have to install an external cache on the machine just for this script. The ideal solution would plugin to Mechanize and transparently cache fetched pages, images and so on.

Anyone know of a library that will do this? Or another way of achieving the same outcome (script runs much quicker second time round)?


Solution

  • How about writing pages out to files, each page in an individual file, and separating the tweak and run cycles?