lcUserName = "seuusuario" lcPassword = "suasenha" oIE = Createobject("InternetExplorer.Application") oIE.Navigate("www.levelextreme.com") If navcomplete(oIE) oIE.Document.Forms(0).username.Value = lcUserName oIE.Document.Forms(0).Password.Value = lcPassword oIE.Document.Forms(0).Submit() oIE.Visible = .T. Else Release oIE Endif Function PageCatalog Lpara oIE Set Talk Off Create Cursor PageCatalog (ItemIndex i, InnerText M, InnerHTML M) For i = 0 To oIE.Document.Body.All.Length - 1 m.ItemIndex = i m.InnerText = oIE.Document.Body.All(i).InnerText m.InnerHTML = oIE.Document.Body.All(i).InnerHTML Insert Into PageCatalog From Memvar Endfor Endfunc Function navcomplete Lpara toIE, tnTimeout lnTimeOut = Iif(Type("tnTimeOut") = "N", tnTimeout, 60) lnElapsedSeconds = 0 lnStartSeconds = Seconds() * First, poll oIE.ReadyState until it equals 4, or we time out Do While .T. If toIE.ReadyState = 4 * Then, toIE.Document.ReadyState until it equals "complete", or we time out Do While .T. If toIE.Document.ReadyState = "complete" Return .T. Endif If (Seconds() - lnStartSeconds) > lnTimeOut Return .F. Endif Enddo Endif If (Seconds() - lnStartSeconds) > lnTimeOut Return .F. Endif Enddo Endfunc