Re: Driving a website using VFP

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: softmica (anonymous_at_discussions.microsoft.com)
Date: 02/09/04


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
     
     
     



Relevant Pages

  • Re: Bus accident on island of Madeira, at least 5 tourists dead
    ... www.cruisemates.com which is a highly acclaimed Internet website that is ... Cruisemates is NOT a travel agency and we do not sell cruises. ... Reports note that we are unbiased about what we report unlike other ... Jim ...
    (rec.travel.cruises)
  • Re: OT: Trademark misuse
    ... Mind you, I agree with Jim, why chase away golden gooses? ... I am also accessing DK website to pull info when customer puts a ... product into the basket and that is the second objection - misuse of the ...
    (comp.arch.embedded)
  • Re: Weld inspection gauges
    ... Jim wrote: ... Newman tools have imposed their ... over the manufacturer on the website as you can see... ... We are one for the larges custom tool and gage house in the US ...
    (sci.engr.joining.welding)
  • Re: RTC has become SPAMMERs Capital in Newsgroups!
    ... Jim you asshole ... Maybe you are too much like Ray GoldenAd to see his ... website and not in response to any lengthy information a poster has ... personal advertising venture and that is just wrong. ...
    (rec.travel.cruises)
  • Re: Driving a website using VFP
    ... 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.... ... There can be no user intervention required as these activities are time-sensitive and need to be controlled automatically by the VFP application. ...
    (microsoft.public.fox.programmer.exchange)