Making a web Bot for Pi 3

i am making a bot that looks for a Add to cart button Through Images So when it finds the button it clicks it i got that down But when The button is not shown it spits out a error Here is the code
`import pyautogui

import time

Null = “None”
while True:
ATC = pyautogui.locateCenterOnScreen(‘AddToCart.png’)

if (ATC == Null):
if (ATC != Null):, ATC.y)
    print("Added To Cart")

And here Is A download To tynker with Everything you need to test AddToCart

This is the error
Traceback (most recent call last):
File “/Users/EVAstudent/Desktop/New Folder With Items/”, line 14, in, ATC.y)
AttributeError: ‘NoneType’ object has no attribute ‘x’

When it works it prints
Added To Cart

Null = “None”

Try replacing this Null with plain None, no quotes.


These functions return None if the image couldn’t be found on the screen.

Does it work?

Thanks So much It works

How do i close a This?

How do i close a This?

I don’t understand the question, sorry.

Guess: “How does one mark the Discussion as Resolved?”.

If that’s the question, there is no need to.

Glad it worked.