c# - Button Click without any ID C# Webbrowser
问题描述
How to click the button without any ID? I tried it with the web browser in C#. I tried the following code:
HtmlElementCollection elc = this.webBrowser1.Document.GetElementsByTagName("button");
foreach (HtmlElement el in elc)
{
if (el.GetAttribute("class").Equals("bb987"))
{
el.InvokeMember("click");
}
}
This is the web code:
<span class="fr66n">
<button class="front"><span class="bb987" aria-label="Press">
</span></button></span>
Anybody who can help?
解决方案
推荐阅读
- android - 如何在 iOS 和 Android 上尽可能快地制作 FCM?
- c# - 在datareader c#中执行命令
- javascript - 圆圈背景无法围绕图标放置
- javascript - 文档不会使用带有 mongoose 的 save() 方法保存
- javascript - 在动态页面中使用 JS 函数
- typescript - 使 complierOptions 在 tsconfig 中生成警告而不是错误
- javascript - 是否可以保存对动态组件的引用并稍后更新@Input/@Output?
- c# - 无法在鼠标事件处理程序中读取 WPF 中键的保持状态 - VMWare Fusion for Mac 上的 Windows 客户机中的行为不一致
- amazon-web-services - SES 发送电子邮件示例,用于给出“在完成请求之前退出进程”错误
- python - 在 Pandas Dataframe 中查找没有零和 NaN 的最小值