CEF4 Get HTML Source
Posted: Mon Jul 05, 2021 6:28 pm
Good day. I understand that the topic has been raised more than once and there have been similar answers on many forums. And right away I want to apologize very much for the flood of the same issue that has been repeatedly raised on this forum and many other forums. But the fact is that not a single answer suited me .... most likely the point is in me: (((((
I've rummaged through a bunch of forums with similar questions ... I don't know what to do already.
I don’t understand how to correctly get the html code of the page loaded in chromium сef4. I try it on chromium 91.0 and Delphi 7. First, I had a question about the combination of two components: Chromium1 and CEFWindowParent1. I have not been able to solve it. There are a lot of options on the Internet, you need to initialize it when you open the form, but then after these actions nothing happens ... The page does not load.
After all TChromium.RetrieveHTML and TChromium.OnTextResultAvailable. But, nothing happens either. I don’t know the answer, maybe it doesn’t work at all on Delphi 7. Please, I beg you to help me.
Here's what I get
As a result, the site does not load and the source code in Memo1 is not obtained
4 Components: Chromium1, CEFWindowParent1, Memo, Button
There are all libraries with the project, but it still does not work, it does not even show an error.
Delphi 7
Help me please ((
I've rummaged through a bunch of forums with similar questions ... I don't know what to do already.
I don’t understand how to correctly get the html code of the page loaded in chromium сef4. I try it on chromium 91.0 and Delphi 7. First, I had a question about the combination of two components: Chromium1 and CEFWindowParent1. I have not been able to solve it. There are a lot of options on the Internet, you need to initialize it when you open the form, but then after these actions nothing happens ... The page does not load.
After all TChromium.RetrieveHTML and TChromium.OnTextResultAvailable. But, nothing happens either. I don’t know the answer, maybe it doesn’t work at all on Delphi 7. Please, I beg you to help me.
Here's what I get
Code: Select all
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, sMemo, sButton, uCEFChromiumCore, uCEFChromium,
uCEFWinControl, uCEFWindowParent, uCEFLinkedWinControlBase,
uCEFChromiumWindow;
type
TForm1 = class(TForm)
Chromium1: TChromium;
Button1: TsButton;
Memo1: TsMemo;
CEFWindowParent1: TCEFWindowParent;
procedure FormCreate(Sender: TObject);
procedure sButton1Click(Sender: TObject);
procedure Chromium1TextResultAvailable(Sender: TObject;
const aText: string);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
begin
Chromium1.CreateBrowser(CEFWindowParent1, '');
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
Chromium1.LoadURL('https://google.com');
Chromium1.RetrieveHTML;
end;
procedure TForm1.Chromium1TextResultAvailable(Sender: TObject;
const aText: string);
begin
Memo1.Text := aText;
end;
4 Components: Chromium1, CEFWindowParent1, Memo, Button
There are all libraries with the project, but it still does not work, it does not even show an error.
Delphi 7
Help me please ((