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 jpg图片 旋转 切边 缩放

Delphi 调用dll文件中的form

Delphi xe 跨平台(windows、android安卓、苹果macos、苹果ios)写法

Delphi richedit的实现msn / qq 中的动画表情

Delphi 能否把.txt文件的数据导入到access数据库中

Delphi 辨析 field、fielddef、fields、fielddefs、fieldlist、fielddeflist

Delphi实现变速齿轮

Delphi编程防止界面卡死的方法

Delphi 通过memorystream 传递image1数据

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



打赏

取消

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

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

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

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

评论

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