Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Automate a Website
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Applications Internet
Divers
Thread ID:
00689020
Message ID:
00689081
Vues:
18
John
You should use HTMLDOM to achieve this. The Web Browser ActiveX control has a Document property. Check out the following example:
**** assuming your Web Browser control is named oWebBrowser
**** also don't forget to put NODEFAULT in the Refresh method of the control
local oDoc
ThisForm.oWebBrowser.Navigate2("www.whatever.com/someentryform")
oDoc = ThisForm.oWebBrowser.Document
with oDoc
   .forms(0).SomeField.Value="John"
   .forms(0).SomeOtherField.Value="Herron"
   .forms(0).Submit() &&& this is equivalent to clicking the submit button
   *** if you know the name of the form, you don't need the forms() array
   .someFormName.SomeField.Value = "Some Value"

   *** also, you can use the all object property, like this:
   *** assuming you want to click a button named "TheButton"
   .all.TheButton.Click()
endwith
As you can see, you'll have to play with it a little to see the properties. If you're using VFP7, you'll get quite a help also from Intellisense.
Do a search for HTMLDOM , or Document and Element objects in MSDN, and you'll reach some explanations and reference about the HTMLDOM object model.

HTH
Jaime

>Hi
>
>I am using CREATEOBJECT("InternetExplorer.Application") then navigating to the website and then using the code below to start to navigae from page to page.
>
>oShell = CreateObject("WScript.Shell")
>oShell.AppActivate(oIE.Document.Title)
>oShell.SendKeys("{TAB}{ENTER}")
>oShell.SendKeys("{TAB}{TAB}{TAB}{ENTER}")
>
>
>This is woking fine until I get to the page I'am after, the website then displays the page in a new instance of internet explorer, when this happens I can't control the new page. I can't navagate to the page directly because the url changes depending on the login user id etc.
>
>I need to get the information from the new page into a VFP7 application .
>The page is just a simple html page with only csv information displayed on it.
>
>So my question is how can I control the new instance of internet explorer created by the website so I can retrieve the information.
>
>Thanks for any suggestions.
>
>John
Why do programs stop working correctly as soon as you leave the Fox?
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform