Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to Get Source Code From HTML Document ?
Message
From
18/02/2004 09:56:39
 
 
To
18/02/2004 04:17:54
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00878010
Message ID:
00878289
Views:
11
Greetings,

You can also use the Internet Transfer Control as well. I've used it before to pull source and then use regular expressions (there is a class library for this) to parse out the HTML.

I have found this to be faster and easier than trying to use the document model to get the HTML out that I want. Once you get your brain around regular expressions you will be spoiled and never want to use VFP to parse strings.

Greg


>Hi,
>>I have created an Internet.Application object and I want to get source of active page. How can I do that?
>
>Sergey's reply is a clean way if you have control over the version of IE installed,
>but will fail for users still at IE4. Also, there can be some "adjusting" of the HTML, done by the parsing engine of IE..
>
>If you need the raw HTML, the safest way is UrlDownloadToFile or other direct calls through WinINet. Another approach is to ask the .document for IPersist* interfaces (works for IE4 as well!), they can persist to File and Memorystream.
>In IE5 IPersist*.Save() didn't change the HTML, but that might have changed with the versions and the patches.
>
>HTH
>
>thomas
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform