Article View: borland.public.cppbuilder.internet.web
Article #379Re: How to get the "real live" HTML source?
From: Remy Lebeau (TeamB)
Date: Sat, 16 Dec 2006 01:13
Date: Sat, 16 Dec 2006 01:13
39 lines
2486 bytes
2486 bytes
"Enrique" <enridp@yahoo.com.ar> wrote in message news:45831d53@newsgroups.borland.com... > the HTML source shows the javascript functions that loads dynamically > some data in the webpage, but I need to parse the data, not the code > that generates it. Then you have to parse the script code itself. Or else actually run the script and then grab its output. > Internet Explorer shows the same HTML source that my code That is because you are grabbing the HTML from Internet Explorer to begin with. That is what TWebBrowser is. > I need to see in the code the same I see in my screen... Then you should use Internet Explorer's DOM interfaces to grab the current text of the desired TimeLeft field. > If you select the price and right click to "view source of selection", > in Firefox, the resulting HTML code is revealed, so clearly once the > javascript has been executed, the browser has the HTML source > of the page somewhere so it can render the page in the browser No, it doesn't. Firefox is dynamically generating new HTML for the source viewer when that menu item is clicked, based on the selected text. You don't have access to that HTML. And it is not the same as the original HTML that was downloaded. > Can you please send me an example code to do that? I can't see it... The IHTMLDocument2 interface (which you get from the TWebBrowser's Document property) has a selection property, which is an IHTMLSelection interface. You can get the text from that. Refer to MSDN for more details. Gambit
Technical Details
Message-ID:
<4583480c$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!news.glorb.com!solnet.ch!solnet.ch!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<4582e657@newsgroups.borland.com> <4582eb35$1@newsgroups.borland.com> <45831d53@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: feeec,b54437b3b496861e X-Google-Attributes: gidfeeec,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Remy Lebeau \(TeamB\)" <no.spam@no.spam.com> Newsgroups: borland.public.cppbuilder.internet.web References: <4582e657@newsgroups.borland.com> <4582eb35$1@newsgroups.borland.com> <45831d53@newsgroups.borland.com> Subject: Re: How to get the "real live" HTML source? Date: Fri, 15 Dec 2006 17:13:36 -0800 Lines: 41 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1409 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 NNTP-Posting-Host: 75.83.34.171 Message-ID: <4583480c$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1166231564 75.83.34.171 (15 Dec 2006 17:12:44 -0800) Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!news.glorb.com!solnet.ch!solnet.ch!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail