Automação em python e pyautogui

Boa noite pessoal, recente fiz uma automação em python com pyautogui, estava indo tudo certo, mas chego em um momento da automação que tenho que esperar alguns minutos para os arquivos subirem no sistema, alguns são rapidos e outros são bem rapidas, o meu problema e. Quando e muito demorado a automação fica tentando achar um botão mas ele nunca acha, ai coloquie para ele apertar ENTER ai beleza, mas voltando no assunto de quando um desses processos demoram muito a automaçãpo fica tentando achar, e quando chega na parte de clilcar no botão que coloquie para achar como foto ou apenas aperta o enter, não vai.

eu queria saber se alguem sabe uma maneira de colocar um tempo ou algo para verificar isso de uma maneira mais elaborada

Google translation:

Good evening everyone, I recently did an automation in Python with Pyautogui, everything was going fine, but I reach a point in the automation where I have to wait a few minutes for the files to upload to the system, some are fast and others are very fast, it is my problem. When it takes a long time, the automation keeps trying to find a button but it never finds it, then tell it to press ENTER, oh great, but returning to the subject of when one of these processes takes a long time, the automation keeps trying to find it, and when it gets to the part of clicking on the button to find it as a photo or just press enter, it won’t work.

I wanted to know if anyone knows a way to set a time or something to check this in a more elaborate way