Solved

WebBrowser - view source

Posted on 2000-02-24
12
515 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
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

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
 

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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

839 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