Almost every answer I\'ve found references using some existing service. Is there a way to do this using Rails 3.1 programmatically? This was dead easy to do wit
There is a Rails gem for this task.
gem install selenium-webdriver
Simple use case:
require 'selenium-webdriver'
width = 1024
height = 728
driver = Selenium::WebDriver.for :firefox
driver.navigate.to 'http://domain.com'
driver.execute_script %Q{
window.resizeTo(#{width}, #{height});
}
driver.save_screenshot('/tmp/screenshot.png')
driver.quit