Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save sawadashota/c0eb078222fdb26798fc98961dd524ac to your computer and use it in GitHub Desktop.
Save sawadashota/c0eb078222fdb26798fc98961dd524ac 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