Skip to content

Instantly share code, notes, and snippets.

@soopa
Created August 23, 2013 21:24
Show Gist options
  • Save soopa/6324191 to your computer and use it in GitHub Desktop.
Save soopa/6324191 to your computer and use it in GitHub Desktop.
Easy screenshots of websites with Ruby
# Gemfile
# source 'https://rubygems.org'
# gem 'poltergeist', :require => 'capybara/poltergeist'
require 'bundler'; Bundler.require
include Capybara::DSL
Capybara.register_driver :poltergeist do |app|
Capybara::Poltergeist::Driver.new(app, :js_errors => false)
end
Capybara.default_driver = :poltergeist
Capybara.javascript_driver = :poltergeist
visit('http://github.com')
save_screenshot('screenshot.png', full: true)
@mgrachev
Copy link

mgrachev commented Jan 8, 2016

For this you can use the gem gastly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment