Skip to content

Instantly share code, notes, and snippets.

@philtr
Created January 30, 2014 05:03
Show Gist options
  • Save philtr/8702915 to your computer and use it in GitHub Desktop.
Save philtr/8702915 to your computer and use it in GitHub Desktop.
Save screenshot of a web page headlessly
require 'headless'
require 'selenium-webdriver'
Headless.ly(dimensions: "1920x1200x24") do
driver = Selenium::WebDriver.for :firefox
driver.navigate.to('http://hellohappy.org/beautiful-web-type/')
driver.save_screenshot('tmp/screenshot.png')
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment