Saving A Screenshot With A Headless Browser
- Install phantomjs with the following:
brew install phantomjs
- Run the phantomjs webdriver:
phantomjs --webdriver=8910
- Install the selenium-webdriver gem:
gem install selenium-webdriver
- Create a driver and grab a screenshot:
driver = Selenium::WebDriver.for(:remote, :url => "http://localhost:8910")driver.navigate.to "http://www.reinke.co"driver.save_screenshot('reinke.co.png')