Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
_WebView: How do I display the HTML source code
Message
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00531187
Message ID:
00531290
Views:
28
>Is there a way to retrieve the source code associated with a URL using the _Webview control. I know that there is a ViewSource method, but it doesn't seem to work.

Chester,

If by "source code", you mean the source HTML, it seems like I remember that you can only get the source for local files on your disk. Another alternative for you is to use automation with Internet Explorer, something like this:
oWeb=CREATEOBJECT("InternetExplorer.Application")
oWeb.Navigate("http://www.yoursite.com")
nMaxSec=10
nSec=Seconds()
Do While oWeb.ReadyState#4
   If Seconds()-nSec>nMaxSec
      Exit
   Endif
Enddo
If oWeb.ReadyState=4
   STRTOFILE(oWeb.Document.Body.OuterHTML,"c:\yourfile.htm")
Endif
You may need to adjust the nMaxSec value to suit your timeout needs.

Regards,
Scott
Scott King
The Support Source Corporation
Previous
Reply
Map
View

Click here to load this message in the networking platform