从输入字段中提取文本-使用Webdriver [英] Extracting text from the input field - using Webdriver
本文介绍了从输入字段中提取文本-使用Webdriver的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何从输入字段中提取文本?我尝试使用XPath/CSSSelector,但由于输入字段是空文本,所以该字段为空.
How would I extract the text from the input filed? I tried using XPath/CSSSelector but I'm getting an empty text and since its a input field.
这是我的html代码:
Here is my html code:
<div>
<input type="text" style="width:110px;" class="display">
</div>
结果:195行中的1至50
Result: 1 to 50 of 195 rows
这是输入字段的屏幕截图:
Here is the screen shot of the input field:
推荐答案
您需要获取字段的值.例如:element.get_attribute("value")
You need to get the field's value. For example: element.get_attribute("value")
这篇关于从输入字段中提取文本-使用Webdriver的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文