title: I want to check if a element (button) on a website is available, and if it is I need a way to store that data and control script flow with a Boolean
body: <p>So first off, Im really new to coding, I took about 2 weeks of skillshare classes, and Im working on my first personal project in Python. The project is a way to learn how to interact with websites and write autonomous scripts. So i decided to start coding an amazon autobuy script. I've written the script up to the point where I need to find out if the Add to cart button is present, and if True I want to be able to print a message to the console, and then proceed to click the button, if it is not then I would like to print a message and reload the webpage. I considered using an if/else statement but as I mentioned I'm pretty new and don't know how to implement it correctly. As of right now I have these 2 lines that locate and check if the button is present by printing ture or false to the terminal.</p>
  <p>*ele = driver.find_element_by_id(&quot;add-to-cart-button&quot;)    # finds add to cart button</p>
  <p>ele=print(ele.is_enabled())   # returns to termianl True or False if add to cart is found*</p>
  <p>So I was thinking with my puny coding knowledge the best way to do it would be to store the True or False value somehow and use that to continue the script, any suggestions on how I could do it? Any help appreciated Im really stuck right now, and I apologize in advance for the terrible formatting, again I'm new lol.</p>
  <p><a href="https://i.stack.imgur.com/ue88q.png" rel="nofollow noreferrer">Code so far</a></p>