我试图让我的应用程序从页面中选择一个选项
如果在网站上寻求帮助,但找不到任何帮助,那么一些帮助就会很好
我的代码:
private void sellCars()
{
HtmlElementCollection elements = this.get_mainframe_tags("img");
IEnumerator enumerator2;
elements = this.get_mainframe_tags("option");
try
{
enumerator2 = elements.GetEnumerator();
while (enumerator2.MoveNext())
{
HtmlElement element2 = (HtmlElement)enumerator2.Current;
Console.WriteLine("Test = " + element2.GetAttribute("value").ToString() + "");
if (element2.GetAttribute("value").ToString() == "sell")
{
Console.WriteLine("Called");
element2.SetAttribute("value", "sell");
}
}
}
finally
{
enumerator2 = elements.GetEnumerator();
if (enumerator2 is IDisposable)
{
(enumerator2 as IDisposable).Dispose();
}
}
}