[英]Python Selenium How to get the text value if no text or value attribute in the element
I tried below ways to get the input field text value, but all of them were failed:我尝试了以下方法来获取输入字段的文本值,但都失败了:
.get_attribute('value')
.text
.get_attribute('textcontent')
Here is the element:这是元素:
<input placeholder="Name" type="text" formcontrolname="name" class="lmn-input ng-star-inserted ng-touched ng-dirty ng-valid">
There exists another method:还有另一种方法:
elem.get_text()
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.