mohammed qadoora mohammed qadoora - 11 months ago 60
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");