Last active
December 7, 2016 01:15
-
-
Save pacojp/e243466f8cb4d9f8884e4dbebf37585b to your computer and use it in GitHub Desktop.
most(?) simple way to take screenshot with ruby
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
# | |
# # install phantomjs | |
# | |
# * https://bitbucket.org/ariya/phantomjs/downloads # simply use binary! | |
# * brew install phantomjs | |
# | |
# # Gemfile | |
# | |
# source 'https://rubygems.org' | |
# | |
# gem 'poltergeist' | |
# | |
require 'capybara/poltergeist' | |
session = Capybara::Session.new(:poltergeist) | |
session.visit "https://www.google.co.jp/maps?source=tldsi&hl=ja" | |
session.save_screenshot "./google.png" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment