Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Automation
Message
 
General information
Forum:
Visual FoxPro
Category:
Internet applications
Title:
Miscellaneous
Thread ID:
00687875
Message ID:
00687954
Views:
37
I think Javascript somehow prevents Submit() from working from program. You can use WSH to send keys directly to the IE window.
oIE = CREATEOBJECT("InternetExplorer.Application")
oIE.Navigate("https://www.bcms.gov.uk/bcms/wctd0001.htm")
oIE.Visible = .T.

DO WHILE oIE.ReadyState <> 3
ENDDO
DO WHILE oIE.Document.ReadyState <> "complete" 
ENDDO

oIE.DOCUMENT.FORMS(1).FARMLOGIN.VALUE = "123-456-789"
oIE.DOCUMENT.FORMS(1).PRVPWD.VALUE = "1234567"

oShell = CreateObject("WScript.Shell")
oShell.AppActivate(oIE.Document.Title)
oShell.SendKeys("{TAB}{ENTER}")
>Hi All
>
>I have been trying to automate a login to a website using FoxPro Adviser June 2000 edition mag I have come up with the folling code.
>
>
>oIE = CREATEOBJECT("InternetExplorer.Application")
>oIE.Navigate("www.bcms.gov.uk/bcms/wctd0001.htm")
>oIE.Visible = .T.
>WAIT "Please Wait..." WINDOW TIMEOUT 15
>oIE.DOCUMENT.FORMS(1).FARMLOGIN.VALUE = "123-456-789"
>oIE.DOCUMENT.FORMS(1).PRVPWD.VALUE = "1234567"
>oIE.DOCUMENT.FORMS(0).Submit()
>
>The Adviser mag had 0 in oIE.DOCUMENT.FORMS(0) but this would not work so I changed it to 1 oIE.DOCUMENT.FORMS(1)
>
>The code works and it inserts the user id and password into the web page but I can't get it to submit the page.
>
>Any ideas?
>
>Also why did changing the oIE.DOCUMENT.FORMS(0) to oIE.DOCUMENT.FORMS(1) make it work?
>
>John
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform