Skip to content

Instantly share code, notes, and snippets.

@pacojp
Last active December 7, 2016 01:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pacojp/e243466f8cb4d9f8884e4dbebf37585b to your computer and use it in GitHub Desktop.
Save pacojp/e243466f8cb4d9f8884e4dbebf37585b to your computer and use it in GitHub Desktop.
most(?) simple way to take screenshot with ruby
#
# # 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