Skip to content

Instantly share code, notes, and snippets.

@zakuroishikuro
Created April 10, 2014 05:42
Show Gist options
  • Save zakuroishikuro/10345608 to your computer and use it in GitHub Desktop.
Save zakuroishikuro/10345608 to your computer and use it in GitHub Desktop.
Mechanizeでローカルファイルを扱う (ディレクトリ内のhtmlの場合)
require 'mechanize'
name = "foo.html"
path = File.expand_path(name, __FILE__)
agent = Mechanize.new
page = agent.get("file://#{path}")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment