How do I make a program that can react to/detect changes in my screen? (preferably in python)

I wanted to automate fishing in a game, so that when the pop-up shows up, the program would detect the change in the screen and performs a certain action. Then reseting and waiting for the pop up again.

I need the to detect the changes because the wait time is random and I couldn’t find anything in the game about changing the player state during the fisihing (egs:snagged or notsnagged).