mohammed qadoora mohammed qadoora - 1 year ago 76
C# Question

select combobox item in website using c#

I need to select a combo box item in a website using c#

i open a website using a web browser

my code is

HtmlElementCollection Col2;
Col2 = webBrowser1.Document.GetElementsByTagName("select");
foreach (HtmlElement ele in Col2)
if (ele.Id == "country")

where is Palestine is one of the items in the combo box.
any help please

Answer Source
webBrowser1.Document.GetElementsByTagName("select").SetAttribute("value", "palestine");
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download