Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
IE automation, navigation and submit
Message
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Titre:
IE automation, navigation and submit
Divers
Thread ID:
01491730
Message ID:
01491730
Vues:
135
Hi

I am trying to automate IE to go a URL and then press submit button and the result page will show ZIP of location.

It works fine on navigation and button pressing, but does not work beyond submit button, because I could not manage to get contents from the result page. ( I can see ZIP on the result page but cannot store contents to a variable: oIE.Document.Body.InnerText )

Please take a look at my code below:


Moises
lnLoadTimeout = 60		&& seconds
loIE = Createobject("internetexplorer.application")
loIE.Visible = .T.


loIE.Navigate("http://www.buscacep.correios.com.br/servicos/dnec/menuAction.do?Metodo=menuFaixaCep")


* Wait for load to complete
lnSeconds = SECONDS()
DO WHILE (loIE.Busy OR loIE.ReadyState <> 4) ;
		AND (SECONDS() - lnSeconds) < lnLoadTimeout
	DOEVENTS
ENDDO


loIE.document.geral.localidade.value = "SAO PAULO" 
loIE.document.geral.UF.value = "SP" 
loIE.document.geral.submit

lnSeconds = SECONDS()
DO WHILE (loIE.Busy OR loIE.ReadyState <> 4) ;
		AND (SECONDS() - lnSeconds) < lnLoadTimeout
	DOEVENTS
ENDDO

                               ***************************************works fine up to this point



lcInnerText = oIE.Document.Body.InnerText     &&&&&&&&&&&&&&&&  "object not found"

? lcInnerText
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform