没有 ID 或名称的 Web 浏览器单击按钮 [英] Webbrowser Click Button With No ID Or Name

查看:26
本文介绍了没有 ID 或名称的 Web 浏览器单击按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 Visual Studio 2012 (Visual Basic) 中的 WebBrowser 单击按钮.我做了很多研究,但我能找到的只是带有 ID 或名称的点击.

I am trying to use the WebBrowser in Visual Studio 2012 (Visual Basic) to click a button. I have done a lot of research, but all I can find is to click with an ID or a name.

这是 HTML 代码.

Here is the HTML code.

<button type='submit' class="btn btn-default" style='float:right'>
    Login<i class="gicon-chevron-right"></i>

我要隐藏网络浏览器,&然后当用户单击 Button1 时,它会调用 webbrowser 上的单击.请帮忙.

I am going to have the webbrowser hidden, & then when the user clicks Button1, it invokes the click on the webbrowser. Please help.

推荐答案

简单代码:

WebBrowser1.Document.Forms(0).InvokeMember("submit")

这篇关于没有 ID 或名称的 Web 浏览器单击按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆