Skip to content

Instantly share code, notes, and snippets.

@shin1ohno
Created May 31, 2012 06:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save shin1ohno/2841546 to your computer and use it in GitHub Desktop.
Save shin1ohno/2841546 to your computer and use it in GitHub Desktop.
ウェブページをまるごとキャプチャする
# 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