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 读取流 image1 stream 加载到image2 timage 对象

Delphi编程之桌面图标设置

Delphi xe 泛型数组和splitstring处理数据

Delphi 获取进程列表及相关信息

Delphi 如何解决在dll的入口函数中创建或结束线程时卡死

Delphi 切换开关 toggleswitch1

Delphi获取13位格林治时间实现方法

Delphi 2010下使用sqlitesimpleDelphi连接sqlite数据库及中文乱码问题的解决

Delphi 如何产生输出一个变形的图形及文字

Delphi unicode转中文编码

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



打赏

取消

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

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

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

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

评论

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