Guide Bot to click others

Hey guys, I been working on task on grabbing price of hotel promotion like trivago. Scenario is simple:

How to make bot grab price if available

And grab sold out notice if not available

They all in one page, the page will keep changing if available/not available, unfortunately my bot will stop working if the UI Element of the website is change.

Is there a way to read all the one page and put condition like if bot read available = grab price, else, grab sold out ? I don’t know how to do that.