I’m using Mechanize to interact with a few web pages, and I’m trying to determine whether a given form submission resulted in an error.
Right now I’m doing this:
agent.page.body.include?("I'm an error message!")
But I just discovered another error message. Since I don’t want to do:
agent.page.body.include?("I'm an error message!") || agent.page.body.include?("Another error message")
How can I determine whether the page body contains either error message?
1 Answer