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

来源:互联网 发布:百度贴吧网络连接失败 编辑:程序博客网 时间:2024/05/01 21:34
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;

0 0
原创粉丝点击