Skip to content

Instantly share code, notes, and snippets.

@jasonhazel
Created July 31, 2013 13:56
Show Gist options
  • Save jasonhazel/6122196 to your computer and use it in GitHub Desktop.
Save jasonhazel/6122196 to your computer and use it in GitHub Desktop.
require 'watir'
require 'open-uri'
SEARCHES = ARGV[0] ? ARGV[0].to_i : 90
def utf(string)
string.force_encoding('UTF-8')
end
browser = Watir::Browser.new :firefox, :profile => 'default'
SEARCHES.times do
word = utf(open('http://randomword.setgetgo.com/get.php').read)
puts "Searching: #{word}"
browser.goto "http://bing.com"
browser.text_field(name: 'q').set word
browser.button(name: 'go').click
end
browser.close
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment