Forked from zakuroishikuro/mechanize_with_local_html.rb
Last active
September 16, 2016 09:23
-
-
Save sawadashota/c0eb078222fdb26798fc98961dd524ac to your computer and use it in GitHub Desktop.
Mechanizeでローカルファイルを扱う (ディレクトリ内のhtmlの場合)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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