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执行js

Delphi tstopwatch 计时

Delphi firedac获取自增长字段值

Delphi编写你的第一个com程序

Delphi整理三(窗体和基本组件)

Delphi获取其他进程中状态栏文本的函数

Delphi android 安卓中保持屏幕常亮

idtcpclient和idtcpclient 主要属性和方法

Delphi中write,read,writeln和readln的用法

Delphi datasnap传输流/文件问题

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



打赏

取消

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

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

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

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

评论

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