Fill a select box using geckofx c#

流过昼夜 提交于 2020-01-01 19:17:08

问题


I am using the code:

((GeckoSelectElement) geckoWebBrowser1.Document.GetElementById("OA0001_dob_month")).Value = "Jul";

But its not working. How to select a value in a selectbox in geckofx c# without using the jscontext?


回答1:


To select a value by index:

var document = GeckoWebBrowser1.Document;
var selectElement = (GeckoSelectElement)document.GetElementById("OA0001_dob_month");
selectElement.SelectedIndex = 2;


来源:https://stackoverflow.com/questions/33259192/fill-a-select-box-using-geckofx-c-sharp

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!