🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.internet.web
3 messages
3 total messages Started by Alim Akyol Wed, 25 Oct 2006 12:28
Queying WEB pages
#719
Author: Alim Akyol
Date: Wed, 25 Oct 2006 12:28
34 lines
2053 bytes
Hi all.

I'm developing a service application with C++ using BDS 2006. This
service supposed to query WEB pages (HTTP or HTTPS) with everything in
them including images, applets, objects (swf, etc.). In addition I want
to be able to get cookies and post data. I'm trying to create an
application which tests WEB servers performance. Thus, I Want to be
able to measure query times of the whole page and each element
individually.

I don't want to use TWebBrowser because of;
1- My application is a Windows Service. There is no user interface and
TWebBrowser must be visible to browse an URL.
2- TWebBrowser uses IE settings. If script debugging is enabled, it
shows dialog box to user and I don't want to change or force user to
change options.
3- If caching is disabled, it does not cache HTML page but it caches
images and other elements.


Is there any component for this purpose?
Can I use IHTMLDocument2 interface to load pages without using
TWebBrowser?

I could use TIdHTTP but I have a doubt about it. I don't want to parse
pages, and handle frames, cookies, SSL pages, etc.

Any help will be appreciated.
Thanks in advance.

Alim Akyol


-- 
Re: Queying WEB pages
#720
Author: Remy Lebeau (TeamB)
Date: Wed, 25 Oct 2006 17:09
43 lines
2574 bytes
"Alim Akyol" <akyolalim@yahoo.com> wrote in message
news:xn0esw68cdluat000@forums.borland.com...

> Is there any component for this purpose?

There are several.  Indy (http://www.indyproject.org), ICS
(http://www.overbyte.be), and Synapse (http://www.ararat.cz/synapse) all
have HTTP client components available.  Or you can use Microsoft's WinInet
or WinHTTP APIs (Internet Explorer uses these internally).

> Can I use IHTMLDocument2 interface to load pages without
> using TWebBrowser?

You can try creating a standalone instance of the IHTMLDocument2 object and
then load HTML into the document as needed:

    IHTMLDocument2 *pDocument = NULL;

    if( SUCCEEDED(CoCreateInstance(CLSID_HTMLDocument, NULL,
CLSCTX_INPROC_SERVER, IID_IHTMLDocument2, (LPVOID*)&pDocument)) )
    {
        // use pDocument as needed ...
        pDocument->Release();
    }

However, without a valid browser to host the document, you will not be able
to directly navigate the document anywhere.  You would have to either
download the HTML manually and then load it into the IHTMLDocument2 via its
IPersistStreamInit interface, or else use CreateURLMoniker() to create a
moniker for a URL and then load it into the IHTMLDocument2 via its
IPersistMoniker interface.

> I could use TIdHTTP but I have a doubt about it. I don't want to
> parse pages, and handle frames, cookies, SSL pages, etc.

You will have to, using any of the above options, because they are all
one-resource-at-a-time downloaders, so you have to parse the HTML to figure
out which additional requests to make.  TWebBrowser (and thus IE) have to do
the same thing internally.


Gambit
Re: Queying WEB pages
#722
Author: Alim Akyol
Date: Thu, 26 Oct 2006 07:29
1 lines
961 bytes
Thanks a lot Remy.
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads