Neil
Mon Feb 09 14:12:16 CST 2004
Hi Jim,
cURL2 contains no forms, so IoForm will get a .NULL. value. You can't
manipulate a non-existent form.
cURL1 uses basic authentication, which is different from HTML form based
authentication. The only way I know around it is to use:
#DEFINE cURL1
"
http://username:password@www.nwaalpa.org/pilots/scheds/index.html"
As Karen pointed out in her reply to my post below, MS screwed this
technique about a week ago with their latest IE security patch, so it
probably isn't a long term solution. Not sure if there's a workaround.
Regards,
Neil
"softmica" <anonymous@discussions.microsoft.com> wrote in message
news:CF2B8031-D4EB-483B-A768-888FD9BDC9E3@microsoft.com...
> 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
>
>
>