Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Obtaining full HTML source from WebBrowser control
Message
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Miscellaneous
Thread ID:
00647241
Message ID:
00651967
Views:
24
>>Hi Vlad,
>>
>>Thanks for the tip. This is the closest I've yet seen to what I was looking for. Note, however, that it doesn't quite pick everything up: it doesn't get the outer HTML tags, for example. It does get the HEAD section, however. I'm not sure if it's possible for this to miss anything sandwiched between the initial HTML and HEAD, and it definitely is not quite as complete as View Source.
>>
>>Mike
>>
>
>You will never get the original source from the control.
>
>The WebBrowser control parse the original source and place all the content in its own object model.
>
>What you get when you query the innerhtml is the "fonctionnal" parsed html code.
>
>You can test it easily, write a simple HTML page and play with the code: change the position of parameters in some tags and thing like that.
>
>Check the innerhtml after the changes and you will get always the same code reordered. Try with a really simple test like "< font face=arial color=#000000 >some text < /font >" in the body of your html page. The innerhtml of the body will return "FONT" instead of "font" and if you move the "color" parameter in front of the "face" parameter you get exactly the same result.
>
>If you want the source, get it directly from the URL using winsock or wwipstuff :-)

Interesting point, Gérald. I'll take your word for it that even document.documentElement.outerHTML is not quite exactly what I was looking for. But there is still one way that would seem to do the trick, assuming that the prompt can be suppressed, which is to use the document.execCommand('SaveAs') method. Note that the scenario of interest to me is one that begins with a WebBrowser control, already navigated to the page in question. I would expect to encounter all sorts of complications trying to get back to that page via winsock or wwipstuff, e.g. if it had been dynamically generated in response to a form, or there had been some password manually entered prior to getting to this page.

Mike
Montage

"Free at last..."
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform