Skip to content

Instantly share code, notes, and snippets.

@mubix
Created May 2, 2014 03:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mubix/47cd30e14c350c6ab7e2 to your computer and use it in GitHub Desktop.
Save mubix/47cd30e14c350c6ab7e2 to your computer and use it in GitHub Desktop.
Screenshotting w/ Selenium and Burp
#!/usr/bin/env ruby
require 'watir-webdriver'
def screenshot(url)
b = Watir::Browser.new
b.goto url
filename = url
if filename =~ /:\/\//
filename = filename.split('://')[1]
end
if filename =~ /\//
filename = filename.split('/')[0]
end
filename = filename + ".png"
b.screenshot.save filename
b.close
end
a = ['http://www.google.com/', 'letmeoutofyour.net', '178.79.164.226', 'https://www.gmail.com']
a.each do |x|
screenshot(x)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment