Created
May 31, 2012 06:52
-
-
Save shin1ohno/2841546 to your computer and use it in GitHub Desktop.
ウェブページをまるごとキャプチャする
This file contains hidden or 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
# coding: utf-8 | |
# !/usr/bin/env ruby | |
require 'rubygems' | |
require 'capybara-webkit' | |
filename = ARGV[0].to_s.gsub("http", "").gsub("://","").gsub(/[\. [\/ \:]]/, "_") + ".png" | |
p "printing... #{filename}" | |
driver = Capybara::Driver::Webkit.new 'web_capture' | |
driver.visit ARGV[0].to_s | |
driver.render "#{filename}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment