Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
IE automation, navigation and submit
Message
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Title:
IE automation, navigation and submit
Miscellaneous
Thread ID:
01491730
Message ID:
01491730
Views:
134
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
Next
Reply
Map
View

Click here to load this message in the networking platform