0
I have a program using pyautogui that fills 20 web formulas sequentially, changing page by page automatically and put a timer for each page of 5 seconds. Usually the pages carry in 2 seconds what gives me a break, but sometimes it takes 20 seconds and the program continues operating running running the functions. I wish I had a line that would let me start qq one of the 20 pages.
import pyautogui
#Pagina 1#
pyautogui.press('tab') # na pagina 1 ele seleciona a caixa de mensagem
pyautogui.write('pagina 1') # escreve "pagina 1" na caixa de mensagem
pyautogui.press('tab', presses=2) # pula até o botao "proxima pagina"
pyautogui.press('enter') # seleciona o botao
pyautogui.sleep(5) # espera 5 segundos ate continuar o proximo comando
#Pagina 2#
pyautogui.press('tab')
pyautogui.write('pagina 2')
pyautogui.press('tab', presses=2)
pyautogui.press('enter')
pyautogui.sleep(5)
#Pagina 3#
pyautogui.press('tab')
pyautogui.write('pagina 3')
pyautogui.press('tab', presses=2)
pyautogui.press('enter')
pyautogui.sleep(5)
If the pages flow with 2 seconds each program finishes the 20 pages normally. If one of them takes too long to load, the program still doesn’t wait. I need something I can stop the program and have the page reset X q piped... Or something that waits for the page to load and just keep going, but I don’t want the option to leave everyone in 20 seconds waiting for the page. Thank you all!
Is the system web? If so, consider using Selenium, which allows you to wait for the page to load.
– Paulo Marques