lib/travian_bot/application.rb in travian_bot-0.1.0 vs lib/travian_bot/application.rb in travian_bot-0.1.1

- old
+ new

@@ -19,16 +19,16 @@ name_input.send_keys(user) password_input.send_keys(password) login_button.submit # Check if building something - #begin + begin building_pipe = driver.find_element(:id, 'building_contract') building_time = driver.find_element(:class, 'buildingTime').text puts wait_till(building_time) - #rescue - #puts 'Nothing to build' - #end + rescue Selenium::WebDriver::Error::NoSuchElementError + puts 'Nothing to build' + end driver.quit return 1 end