http://stackoverflow.com/questions/13324095/get-html-source-from-chromium-embedded

How to do this with Delphi Chromium Embedded Component i know how to do this with TWebBrowser. But since no docs are present for this I am sure someone else had same problem.

Thanks

improve this question
 
add a comment

2 Answers

up vote7down voteaccepted

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;
improve this answer
 
add a comment
 

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;

相关文章:

  • 2021-06-22
  • 2021-05-06
  • 2021-09-02
  • 2021-08-25
  • 2021-12-31
  • 2021-11-25
猜你喜欢
  • 2021-05-03
  • 2021-07-25
  • 2021-09-14
  • 2022-03-03
  • 2022-12-23
  • 2021-10-31
  • 2021-11-08
相关资源
相似解决方案