Webbrowser点击没有ID和Name的按钮或链接


本文整理自网络,侵删。

  uses ActiveX, ComObj, MSHTML


Procedure ButtonClinkByText(Wbr:TWebBrowser); //比如QQ邮箱登陆的那个按钮
var
len,I:integer;
item:OleVariant;
begin
item:=Wbr.OleObject.Document.getElementsByTagName('input'); //根据 标记 找,也可以根据其他找的
Len:=item.Length;
for I:=0 to len-1 do
begin
if pos('登陆',item.item(i).value)>0 then
begin
item.item(i).click;
end;
end;
end;



procedure TForm1.Button1Click(Sender: TObject);
begin
ButtonClinkByText(WebBrowser1);
end;

相关阅读 >>

Delphi ticon保存ico文件时失真的解决办法

Delphi用idhttp提交自定义cookie

Delphi synedit的安装和基本使用

Delphi之截取整个窗体图片

Delphi xe android将域名转化为ip

Delphi 内存中加载dll

Delphi fmx 把内容复制到粘贴板上支持跨平台

Delphi adoconnection连接 sqlserver

Delphi 方便的文本文件操作(text)

Delphi 一个call应该如何写?

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



打赏

取消

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

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

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

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

评论

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