<i>
<input id="date-day" class="myclass" type="text"
value="" readonly="readonly" placeholder="DD"
name="EarliestLiveDateDD" maxlength="2"
data-val-required="The Earliest Delivery date: field is required."
data-val-number="The field Earliest Delivery date: must be a number."
data-val="true"/>
,
</i>
显示的文本框值为22
尝试使用get text并获取Attribute但无法获取文本。
答案 0 :(得分:0)
driver.FindElement(By.Id("date-day")).GetAttribute("value");