Skip to content

Instantly share code, notes, and snippets.

@bsdmad
Last active February 28, 2019 09:10
Show Gist options
  • Save bsdmad/5735705 to your computer and use it in GitHub Desktop.
Save bsdmad/5735705 to your computer and use it in GitHub Desktop.
Selenium を使って Web サイトのスクリーンショットを取得できる、ということなので試してみた。 実際、取れたのでスゴイね! 後はブラウザを非表示にして実行できれば、定期的に自動取得できるかな?
require 'selenium-webdriver'
driver = Selenium::WebDriver.for :firefox
driver.navigate.to 'http://www.netforest.ad.jp/'
driver.save_screenshot('netforest.png')
driver.quit
#テスト
## テスト
@bsdmad
Copy link
Author

bsdmad commented Jun 9, 2013

粘ってみたけど、現時点では

  1. Firefox を silent mode で起動する方法
  2. スクリーンショットのサイズを指定する方法

が分からない。ダメなのかな?

@bsdmad
Copy link
Author

bsdmad commented Jun 9, 2013

Window のリサイズは簡単。

http://qiita.com/items/bfede5cebc3c9996b7aa

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