Last active
July 21, 2017 17:20
-
-
Save jeffmcfadden/ea0e867bcc310316afdd1a05f1ec0456 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
require 'watir' | |
browser = Watir::Browser.new | |
while true do | |
begin | |
browser.goto "http://www.radiotimes.com/news/2017-07-21/radio-times-radio-and-podcast-champion-round-4-5" | |
sleep 1 | |
puts "Clicking Brady Haran" | |
browser.radio(name: "PDI_answer9793268", value: "44802685" ).set | |
sleep 1 | |
puts "Clicking Vote" | |
browser.link(id: 'pd-vote-button9793268').click | |
sleep 1 | |
rescue Selenium::WebDriver::Error::UnhandledAlertError | |
puts "Clicking OK on alert" | |
browser.alert.ok | |
rescue StandardError => err | |
puts "Error: #{err}" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment