Skip to content

Instantly share code, notes, and snippets.

@trinary
Created August 9, 2011 18:40
Show Gist options
  • Save trinary/1134849 to your computer and use it in GitHub Desktop.
Save trinary/1134849 to your computer and use it in GitHub Desktop.
#!/bin/env ruby
#
require 'rubygems'
require 'capybara'
require 'capybara/dsl'
require 'capybara-webkit'
class CapybaraWalker
include Capybara
def initialize(url)
Capybara.default_driver = :webkit
Capybara.run_server = false
Capybara.app_host = url
Capybara.visit(url)
Capybara.fill_in('q', :with => 'kitten pictures')
Capybara.click_button("I'm Feeling Lucky")
puts Capybara.current_url
end
end
walker = CapybaraWalker.new('http://www.google.com/')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment