我有一个大问题,我需要解决方案 我在网页上有html代码:
<input class="fPersonalInput" name="email" id="email" value="" data-value="adres e-mail" maxlength="33" type="text">
我不知道如何关注这个元素
非常感谢任何帮助........提前致谢
答案 0 :(得分:1)
答案 1 :(得分:0)
我认为你需要的是:
1)获取元素参考
2)调用Focus()方法
(Browser.Document.GetElementById("email") as GeckoHtmlElement).Focus();
但是,如果您需要设置焦点以设置其值,请务必不要使用任何&#39; SendKeys()&#39;方法或类似方法,而只是设置如下的值:
(Browser.Document.GetElementById("email") as GeckoInputElement).Value = "busy@the.moment";