Re: Driving a website using VFP
From: softmica (anonymous_at_discussions.microsoft.com)
Date: 02/09/04
- Next message: Philippe Sevin: "Re: register a .OCX"
- Previous message: Shan: "RE: How can delete all files and folder in a folder by a single command in vfp?"
- In reply to: David Frankenbach: "Re: Driving a website using VFP"
- Next in thread: Neil Waterworth: "Re: Driving a website using VFP"
- Reply: Neil Waterworth: "Re: Driving a website using VFP"
- Reply: David Frankenbach: "Re: Driving a website using VFP"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 9 Feb 2004 08:36:08 -0800
I tried this code:
#DEFINE cURL1 "www.nwaalpa.org/pilots/scheds/index.html"
#DEFINE cURL2 "www.nwaalpa.org"
oIE = CREATEOBJECT("internetexplorer.application")
oIE.Visible = .T.
oIE.Navigate(cURL2)
DO WHILE oIE.Busy()
doevents
ENDDO
IoDoc = oIE.Document
IoForm = IoDoc.Forms(0)
FOR i = 0 TO IoForm.Length-1
?i,ioForm.Item(i).Name, IoForm.Item(i).Value
Endfor
*******
Got the error "IoForm is not an object" What's happening here and is there any way around it? Still don't see how I will separately identify the authentication form that appears first if I select cURL1 which is the URL I really want to start with.
----- David Frankenbach wrote: -----
Jim,
It's pretty easy to automate a form in IE:
oIE = createobject( "internetexplorer.application" )
oIE.Visible = .t.
oIE.Navigate( "www.google.com" )
do while oie.Busy()
doevents
enddo
loDoc = oIE.Document && get the Document object
loForm = loDoc.forms(0) && get the first form object
loForm.Item(3).Value = "foxpro" && this is the field for the search string
loform.Submit() && submit the form
you can use code like to find the items of a form:
* explore the form items
for i = 0 to loForm.Length-1
? i, loForm.Item(i).Name, loForm.Item(i).Value
endfor
You can also access the items by their names:
loItem = loForm.item( "q" )
loItem.value = "this is so cool"
If you have VFP8 or VFP7 this stuff becomes really trivial because of
Intellisense. You can just kind of explore things from the command window.
You can also lookup IE DocumentObjectModel (DOM) on MSDN to help direct your
explorations.
--
df - Microsoft MVP FoxPro http://www.geocities.com/df_foxpro
"softmica" <anonymous@discussions.microsoft.com> wrote in message
news:A185ED1E-F9DF-4CC9-B80C-00A552C1C265@microsoft.com...
> What I am trying to do is log onto a website and then navigate to the
appropriate page and then click a link which will initiate a file
download.... although I want to be able to specify the download location
without user intervention.
>> In another section of the program, I want to log onto another website,
select another page which will again require a log on, and then fill in
certain fields automatically (again... no user intervention), submit the
website and then copy the confirmation page that is generated to a memo
field in a VFP application.
>> There can be no user intervention required as these activities are
time-sensitive and need to be controlled automatically by the VFP
application.
>> I've tried westwind stuff and it didn't work for what I need to do. I am
amazed that nobody is routinely doing this.
>> Anyway, if you have some specific ideas, let me know. I've tried to use
the InternetExplorer object but I cannot identify the logon page when it
comes up.
>> Hope you or someone else has some ideas.
>> Jim
- Next message: Philippe Sevin: "Re: register a .OCX"
- Previous message: Shan: "RE: How can delete all files and folder in a folder by a single command in vfp?"
- In reply to: David Frankenbach: "Re: Driving a website using VFP"
- Next in thread: Neil Waterworth: "Re: Driving a website using VFP"
- Reply: Neil Waterworth: "Re: Driving a website using VFP"
- Reply: David Frankenbach: "Re: Driving a website using VFP"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|