码迷,mamicode.com
首页 > Web开发 > 详细

cef3 获得 谷歌浏览器 网页源码 哈哈

时间:2016-11-03 02:48:44      阅读:508      评论:0      收藏:0      [点我收藏+]

标签:pst   everyone   its   delphi   rac   nav   alt   idt   mbed   

Get HTML Source from Chromium Embedded

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

shareimprove this question
 

2 Answers

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;
shareimprove this answer
 
 

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;

cef3 获得 谷歌浏览器 网页源码 哈哈

标签:pst   everyone   its   delphi   rac   nav   alt   idt   mbed   

原文地址:http://www.cnblogs.com/delphi-xe5/p/6025107.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!