🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.internet.web
Article #377

Re: How to get the "real live" HTML source?

#377
From: Remy Lebeau (TeamB)
Date: Fri, 15 Dec 2006 20:19
32 lines
2288 bytes
"Enrique" <enridp@yahoo.com.ar> wrote in message
news:4582e657@newsgroups.borland.com...

> I'm having problems to obtain the HTML source from webpages
> that refresh its content dynamically by javascript functions.

You cannot extract the generated HTML in that situation.  The only way to
get the generated HTML would be to actually run the Javascript and capture
its output.  Which means parsing the original HTML, extracting the
Javascript code, setting up your own COM objects to mimic the Internet
Explorer DOM, and then running everything through the Windows Scripting
Host.  In other words, you are looking at a lot of extra work in order to
handle dynamic content.

> I can't find the data that I'm seeing in my screen.

That is because you are extracting the original raw HTML, not the
javascript-modified HTML.

> My solution (very inefficient) was to wait for the page loads completly,
> then select all, copy to clipboard and then "paste" it to an AnsiString...
> it works, but it has many problems, for example, I loss the content of the
> clipboard, it's very imprecise, requieres a lot of extra code and
resources,
> etc.

You don't need to copy to the clipboard to get the selected text.  You can
query it from the DOM directly.


Gambit
Technical Details
Message-ID: <4583031e$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!news3.google.com!news.glorb.com!newsgate.cistron.nl!xs4all!news2.euro.net!213.132.189.2.MISMATCH!multikabel.net!feed20.multikabel.net!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <4582e657@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>
Subject: Re: How to get the "real live" HTML source?
Date: Fri, 15 Dec 2006 12:19:59 -0800
Lines: 34
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: <4583031e$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1166213918 75.83.34.171 (15 Dec 2006 12:18:38 -0800)
Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!news3.google.com!news.glorb.com!newsgate.cistron.nl!xs4all!news2.euro.net!213.132.189.2.MISMATCH!multikabel.net!feed20.multikabel.net!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail