Link to home
Start Free TrialLog in
Avatar of F31203
F31203

asked on

WebBrowser - view source

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
ASKER CERTIFIED SOLUTION
Avatar of dotan
dotan

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of F31203
F31203

ASKER

Dear Dotan,

What is the declaration of FDoc and
IHtmlDocument2 ?

Regards,

Pascal
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
Avatar of F31203

ASKER

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
Give me your E-Mail and i'll send it 2 u
If u have IE5 i think you can find this component in:
....\Common Files\Microsoft Shared\Triedit\DHTMLEd.OCX
Avatar of F31203

ASKER

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
Ok
Dotans@goldmail.net.il
did u try this ?

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

ASKER

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
you have to import the Mshtml.dll from the windows\system directory and then include the MSHTML_TLB
Avatar of F31203

ASKER

Fine, it is running very well now !
Thanks for your help,

Pascal