Get HTML Source from Chromium Embedded
Here is how you do it..
procedure TCustomLoad.OnLoadEnd(const browser: ICefBrowser;
const frame: ICefFrame; httpStatusCode: Integer);
var
data:tstringlist;
begin
data:=tstringlist.create;
if frame.IsMain then
data.text:=frame.Source; // HTML Source
end;
data.free;
end;
in dcef 3
procedure StringVisitor(const str: ustring);
begin
//str is the SourceHtml
showmessage(str);
end;
function GetSourceHTML: string;
var
CefStringVisitor:ICefStringVisitor;
begin
CefStringVisitor := TCefFastStringVisitor.Create(StringVisitor);
Chromium1.Browser.MainFrame.GetSource(CefStringVisitor);
end;