Created
August 9, 2011 18:40
-
-
Save trinary/1134849 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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