如何在C#.Net中通过硒清除<input>文本的先前值?

问题描述

我想通过硒(do-while)在一个特定的网站上订购几次,但是单击订购按钮后,该网站不能清除文本的值。我想在C#.Net中按硒单击按钮后清除文本值,以便重复执行命令。我的代码是:

  {
    "name" : "javafx.scene.layout.GridPane","allDeclaredConstructors" : true,"allPublicConstructors" : true,"allDeclaredFields" : true,"allPublicFields" : true,"allDeclaredMethods" : true,"allPublicMethods" : true
  }

解决方法

尝试下面的代码-应该可以。

BuyActions.MoveToElement(cDriver.FindElementByCssSelector("#send_order_txtPrice"));
BuyActions.Clear();
BuyActions.Click();                
BuyActions.SendKeys(BuyPrice);

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...