Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to do
Message
From
13/08/2001 14:46:36
 
 
To
13/08/2001 13:09:55
General information
Forum:
Visual FoxPro
Category:
Internet applications
Title:
Miscellaneous
Thread ID:
00543113
Message ID:
00543189
Views:
19
>How do I do 'screen scraping' from VFP? I need to call a URL from inside of VFP and then grab some fields on the HTML Web page that comes up in Internet Explorer.

Here is a sample from the UT download "StartUT.prg" :
oIE = CREATEOBJECT("InternetExplorer.Application")
oIE.Navigate("www.levelextreme.com")

INKEY(1)
nStartSeconds = SECONDS()
DO WHILE oIE.Document.ReadyState <> "complete" AND (SECONDS()-nStartSeconds < 30)
ENDDO

IF oIE.Document.ReadyState <> "complete"
	MESSAGEBOX("Universalthread is unavailable")
	oie.Visible = .T.
	RETURN .F.
ENDIF

oie.document.forms(0).Key.Value = lcUsername
oIE.Document.Forms(0).Password.Value = lcPassword

oIE.Document.Forms(0).Submit()
oIE.Visible = .T.
Where the web page's fields are accessible through IE's DOM, the forms collection in this case.
Previous
Reply
Map
View

Click here to load this message in the networking platform