A website shows a table based options to choose. HTML
is
-
You have multi radio button input you must loop through them,try this:
private void Form1_Load_1(object sender, EventArgs e)
{
webBrowser1.Navigate("url");
}
private void webBrowser1_DocumentCompleted_1(object sender, WebBrowserDocumentCompletedEventArgs e)
{
foreach (HtmlElement el in webBrowser1.Document.GetElementsByTagName("input"))
{
if (el.Name == "gatewayIDV")
{
el.InvokeMember("Click");
}
}
}
Edited
For specific radio button
private void Form1_Load_1(object sender, EventArgs e)
{
webBrowser1.Navigate(@"E:\Documents and Settings\Ali\Desktop\ww.html");
}
private void webBrowser1_DocumentCompleted_1(object sender, WebBrowserDocumentCompletedEventArgs e)
{
foreach (HtmlElement el in webBrowser1.Document.GetElementsByTagName("input"))
{
if (el.Name == "gatewayIDV" && el.OuterHtml.Contains("setBank(11,0,1)"))
{
el.InvokeMember("Click");
}
}
}
讨论(0)
- 热议问题