Solved

WebBrowser - view source

Posted on 2000-02-24
12
511 Views
Last Modified: 2010-04-04
I would like to extract the WebBrowser
content in a memo (as it does when right click on the HTML page - view source).

(P.S. : I cannot use HTTP.get('URL') because of problems with proxy authentication)

Help would be appreciated,

Regards,

Pascal
0
Comment
Question by:F31203
  • 7
  • 5
12 Comments
 

Accepted Solution

by:
dotan earned 50 total points
ID: 2554151
FDoc := FWebBrowser.Document As IHtmlDocument2;
ShowMessage(FDoc.body.outerHTML)
0
 

Author Comment

by:F31203
ID: 2554278
Dear Dotan,

What is the declaration of FDoc and
IHtmlDocument2 ?

Regards,

Pascal
0
 

Expert Comment

by:dotan
ID: 2554638
If you import the "DHTML edit control" from the ActiveX wizard you shold be able to use it.
It let's you control the HTML in your browser
0
 

Author Comment

by:F31203
ID: 2554749
I am actually running Delphi 5 C/S : if I select Component, Import ActiveX Control..., I have no "DHTML edit control".  It seems to be a .dll or an .ocx file ???

Pascal
0
 

Expert Comment

by:dotan
ID: 2555113
Give me your E-Mail and i'll send it 2 u
0
 

Expert Comment

by:dotan
ID: 2555151
If u have IE5 i think you can find this component in:
....\Common Files\Microsoft Shared\Triedit\DHTMLEd.OCX
0
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 

Author Comment

by:F31203
ID: 2557390
Dotan,

OK, I have installed IE5 and registered the DHTML ... ActiveX component.

May I send you my example, because I don't see where I can define the FDoc ???

Pascal
0
 

Expert Comment

by:dotan
ID: 2562223
Ok
Dotans@goldmail.net.il
0
 

Expert Comment

by:dotan
ID: 2564662
did u try this ?

procedure TForm1.Button1Click(Sender: TObject);
var
  FDoc: IHtmlDocument2;
begin
FDoc := WebBrowser1.Document As IHtmlDocument2;
ShowMessage(FDoc.body.outerHTML);
end;
0
 

Author Comment

by:F31203
ID: 2564693
Yes, but it stops at the declaration
var FDoc:IHtmlDocument2; (undeclared identifier).

Here is my uses parameters :

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls, OleCtrls, SHDocVw, ExtCtrls, DHTMLEDLib_TLB, OleServer, Word97;

Pascal
0
 

Expert Comment

by:dotan
ID: 2564791
you have to import the Mshtml.dll from the windows\system directory and then include the MSHTML_TLB
0
 

Author Comment

by:F31203
ID: 2564915
Fine, it is running very well now !
Thanks for your help,

Pascal
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Suggested Solutions

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now