Delphi 从 TWebBrowser中获得当前输入处的链接


本文整理自网络,侵删。

 
var unsubscribeStr : string;
    ovSelection: OleVariant;
    innerDom, ovTextRange, nnode: OleVariant;
begin
       ovSelection := Edit.doc.selection; //获得选择对象
       ovTextRange := ovSelection.createRange; // create a TextRange from the current selection
       if SameText(ovTextRange.parentElement.tagName, 'a') then
       begin
         //是链接,在这里进行处理
         ovTextRange.parentElement.outerHtml;  //链接的完整 HTML 
       end;
end;

相关阅读 >>

Delphi 获取外部程序句柄与发送消息

Delphi调用游戏call代码

Delphi 检测文件是否被占用

Delphi 服务器与客户端的时间同步

Delphi 压缩与修复access数据库

Delphi idtcpclient1实现端口扫描器

Delphi ini文件操作 tinifile、tmeminifile

Delphi tidhttpserver开发http服务端外网无法访问

Delphi xe5、6、7在android或者ios上使用ansistring和ansichar

Delphi 判断当前程序是否是活动窗口

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...