我在互联网上搜索了一些例子;
"如何在C#中单击webBrowser(Internet Explorer)中的按钮?"
JS:
void ClickButton(string attribute, string attName)
{
HtmlElementCollection col = webBrowser1.Document.GetElementsByTagName("input");
foreach (HtmlElement element in col)
{
if (element.GetAttribute(attribute).Equals(attName))
{
element.InvokeMember("click"); // Invoke the "Click" member of the button
}
}
}
Run Code Online (Sandbox Code Playgroud)
但我的网页按钮有不同的标签.因此程序无法检测到单击它.
我的主要问题是; 如何以编程方式单击此按钮?
HTML:
<a class="orderContinue" href="Addresses" title="Sipar Ver">Sipar Devam</a>
Run Code Online (Sandbox Code Playgroud)