get xml information using webbrowser control

I am using a webbrowser control in vb6 and I want to get the xml information from it.  If I use view source on the web page I can see the xml information but when I put the html information into a text box the xml information is not there.
Who is Participating?
b1xml2Connect With a Mentor Commented:
the problem rjef is this.

whenever you obtain a snapshot of the underlying data via the web browser control thru VB Code, you see the actual state of the DOM. This is not true with viewing the source via the Browser itself. Here the DOM may be re-arranged but you do not see the changes.

Under MSIE per se, all XML documents are transformed immediately with the defaultss.xsl.


Under the Browser Control's Document.body.innerHTML, you see the state of the DOM as it actually is and as such, you will see the transformed output. If you were to view it via the View Source Menu, you will see the XML document as it actually is.

If you want to view the XML, you should not be using the WebBrowser Control but the XMLHTTP object or DOMDocument30 | DOMDocument40 Object.

Sample Code
Set oHTTP = New Msxml2.XMLHTTP30 "GET","", False
Debug.Print oHTTP.responseXML.xml
Richie_SimonettiIT OperationsCommented:
How do you get source code?

' in document_complete event of webbrowser

debug.print webbrowser.document.documentelement.innerhtml
rjefAuthor Commented:
It doesn't give the same results as right click 'select all' then 'copy' then 'paste' into notepad. This is really what I want. It looks like it is giving the xml commands but not the data from the commands.
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

There seems to be no way to use the Webbrowser control to get the underlying XML source.
You need to retrieve the original XML file.
Richie_SimonettiIT OperationsCommented:
"It doesn't give the same results as right click 'select all' then 'copy' then 'paste' into notepad.

Sorry, i don't understand, you did never talk about copy/paste stuff. Your primary question was:
".  If I use view
source on the web page I can see the xml information but when I put the html information into a text
box the xml information is not there. "
XML in IE is converted to that syntax-highlighted HTML when displayed.

So it is:
Richie_SimonettiIT OperationsCommented:
Well, what we need here, html code or pure text contents?
pure text = xml
rjefAuthor Commented:
Ok lets stick with 'I need the same as view source'
The innertext does not give the same as view source.
The innerhtml does not give the same as view source
The selectall and copy does not give the same as view source

example innerhtml
<TD class=fm24 style="BORDER-TOP-STYLE: none; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BORDER-BOTTOM-STYLE: none" colSpan=3>Carrier</TD></TR></TBODY></TABLE></TD>
<TD class=fm26 style="BORDER-RIGHT: #999999 1px solid; PADDING-RIGHT: 0px; BORDER-TOP: #999999 1px solid; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; BORDER-LEFT: #999999 1px solid; PADDING-TOP: 0px; BORDER-BOTTOM: #999999 1px solid">
<TABLE class=fm26 style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" cellSpacing=0 cellPadding=0 width="100%" border=0>

example innertext
19598783471203248663669PS80-02-F0778NULLNULLNULL5023-Apr-02 06:00 AM20-APR-2002YORK INTERNATIONAL S.A. DE C.VUPS NEXT DAYPA23-APR-2002
295989217112125776730104391-8-365..269NULLNULLNULL10006-May-02 08:00 PM26-APR-2002PARKER HANNIFIN CORPORATIONUPS GRNDOP06-MAY-2002

example viewsource
td class="fm31">663669</td><td class="fm32">PS80-02-F0778</td><td class="fm33">NULL</td><td class="fm34">NULL</td><td class="fm35">NULL</td><td class="fm36">50</td><td class="fm37">23-Apr-02 06:00 AM</td><td class="fm38">20-APR-2002</td><td class="fm39">YORK INTERNATIONAL S.A. DE C.V</td><td class="fm40">UPS NEXT DAY</td><td class="fm41">PA</td><td class="fm42">23-APR-2002</td></tr><tr><td class="row_number_cell">2</td><td class="fm29">959892171</td><td class="fm30">1212577</td><td class="fm31">673010</td><td class="fm32">4391-8-365..269</td><td class="fm33">NULL</td><td class="fm34">NULL</td><td class="fm35">NULL</td><td class="fm36">100</td><td class="fm37">06-May-02 08:00 PM</td><td class="fm38">26-APR-2002</td><td class="fm39">PARKER HANNIFIN CORPORATION</td><td class="fm40">UPS GRND</td><td class="fm41">OP</td><td class="fm42">06-MAY-2002</td></tr><tr><td class="row_number_cell">3</td><td

'selectall'  'copy'
1 959878347 1203248 663669 PS80-02-F0778 NULL NULL NULL 50 23-Apr-02 06:00 AM 20-APR-2002 YORK INTERNATIONAL S.A. DE C.V UPS NEXT DAY PA 23-APR-2002
2 959892171 1212577 673010 4391-8-365..269 NULL NULL NULL 100 06-May-02 08:00 PM 26-APR-2002 PARKER HANNIFIN CORPORATION UPS GRND OP 06-MAY-2002

If I could get the viewsource example the data I need is between the '>' '<'
> <TD class=fm26 style="BORDER-RIGHT: #999999 1px solid;

Note: This doesn't look like XML at all, and it doesn't look like XML automatically converted to HTML by IE.

What is WebBrowser1.LocationURL?
rjefAuthor Commented:
It is an internal website
What do you mean by,

>  I want to get the xml information from (an HTML document)

and what's the difference between an "internal" and an "external" website, regarding your question?
This is not a very clear question, try to make it clear or it's lost :-)
rjefAuthor Commented:
What I want to be able to get using the webbrowser control is the exact same information I get when I use the view>source option in the Internet Explorer.  I thought it was xml but I guess it is not.
The web site is internal to our company (behind a firewall)  I think it could also be called the intranet.

Hi rjef,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will ask a Community Support Moderator to:

    Accept b1xml2's comment(s) as an answer.

rjef, if you think your question was not answered at all or if you need help, just post a new comment here; Community Support will help you.  DO NOT accept this comment as an answer.

EXPERTS: If you disagree with that recommendation, please post an explanatory comment.
DanRollins -- EE database cleanup volunteer
per recommendation

Community Support Moderator @Experts Exchange
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.