Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Reading ASP data from a web page to VFP
Message
 
 
À
10/10/2000 14:47:55
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00427292
Message ID:
00427484
Vues:
13
>>Greetings to all,
>>
>>I read Erik Moore's article in the June 2000 "FoxPro Advisor" magazine and tried to retrieve data from the web site www.unos.org using the following code provided in that article:
>>
>>CREATE CURSOR pagecatalog (ItemIndex i, InnerText M, InnerHTML M)
>>FOR i = 0 TO oie.DOCUMENT.body.ALL.LENGTH -1
>>m.ItemIndex = i
>>m.InnerText = oie.DOCUMENT.body.ALL(i).InnerText
>>m.InnerHTML = oie.DOCUMENT.body.ALL(i).InnerHTML
>>INSERT INTO pagecatalog FROM MEMVAR
>>ENDFOR
>>
>>None of the data in the frames was retrieved! I was given the following code previously get at the frames directly to try this code:
>>
>>? oIE.Document.Frames(1).Document.Body.innerText
>>? oIE.Document.Frames(2).Document.Body.innerText
>>? oIE.Document.Frames(3).Document.Body.innerText
>>? oIE.Document.Frames(4).Document.Body.innerText
>>
>>and nothing printed out to the VFP screen. It works well on other pages but not the one in question.
>>
>>I am a new VFP developer and I would greatly apprecieate a place to start with solving this problem.
>
>IE sometimes acts screwy when frames are involved. I haven't pegged what it is about certain pages that render the frames collection inoperable, but it happens. The workaround I use is to view the source of the top-level page, and get the URL of the individual pages that make up the frame, and load them by themselves. For the page that you posted, you can just load:
>http://www.unos.org/frame_SubCat.asp
>To get the main page. From here, the All collection should work fine.

"IE sometimes acts screwy when frames are involved." - No kidding.
Check out that last statement!
set memowidth to 999oIE = CREATEOBJECT("InternetExplorer.Application")
oIE.Visible = .T.
? "Navigate to http://www.unos.org/frame_Default.asp and then resume."
suspend
? oIE.Document.Frames.top.document.frames.item(1).document.frames.item(1).document.frames.document.body.innerText
censored.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform