SELECT REEMBOLSO SCAN for reembolso.retirou = .F. .AND. reembolso.dev = .F. .AND. reembolso.pg = .F. AND reembolso.old = .F. .and. DATE() - reembolso.date > 1 PUBLIC lcInnerText oIE = CreateObject("InternetExplorer.Application") #DEFINE READYSTATE_COMPLETE 4 #DEFINE MAX_TIME 30 local lcInnerText && Text of the webpage local lcIPAdd && IP Address as a string local lnStartedAt && Seconds when started loading local lnWaiting && Seconds waiting for the document to load local lcRetVal && Return Value STORE ALLTRIM(Reg_tipo) + ALLTRIM (REG) + "BR" to obj_num lnStarted = SECONDS() lcUrl = "http://websro.correios.com.br/sro_bin/txect01$.QueryList?P_LINGUA=001&P_TIPO=001&P_COD_UNI=" + obj_num oIE.navigate(lcUrl) do while oIE.Readystate <> READYSTATE_COMPLETE or lnWaiting >= MAX_TIME lnWaiting = Seconds() - lnStarted enddo if lnWaiting < MAX_TIME lcInnerText = oIE.Document.Body.InnerText else lcInnerText = "?????" endif *ENDDO