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 tdictionary 简单用法

Delphi 删除字符串重复的符号只保留一个

Delphi 程序动态改变皮肤

Delphi twebbrowser出现 method pastehtml not supported by automation object 解决方法

Delphi版进程间的相互调用与参数传递

Delphi andorid应用程序检查wifi有效还是无效

Delphi 执行一个外部程序,当外部程序结束后言主程序立即响应

Delphi getfilesize 获取文件大小 2

Delphi 获取所有磁盘盘符列表

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



打赏

取消

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

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

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

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

评论

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