我找不到一个元素。我正试图找到它并在字段中输入一些数据。我注意到类名有空格,并且ID是自动生成的(与其他表单比较),所以不能使用ID进行自动化,因为我希望自动创建新表单,并且每次都使用“Description”字段。在
下面是描述字段的html,我正试图找到它。在
<input size="15" maxlength="255" class="acitem description s-description ui-autocomplete-input" spinner="/assets/spinner-48c6e73f2bbe9ea753f7f8e5410541a8138d19d657ddd532b2765335ed3d62bf.gif" auto_complete="true" data-autocomplete-url="/items/auto_complete" data-autocomplete-renderer="item_autocomplete_renderer" data-autocomplete-delay="250" type="text" name="invoice[invoice_lines_attributes][68345][description]" id="invoice_invoice_lines_attributes_68345_description" autocomplete="off">
到目前为止我使用的代码都失败了。在
^{pr2}$我是不是把代码搞错了,或者是有一些解决方法来解决类名中有空格的问题?谢谢。在
几乎所有情况下,DOM中的所有元素都可以通过XPATH访问。 在你的情况下,我会同意以下几点:
尝试使用xpath
谢谢你的帮助。我用start-with和contains解决了这个问题。 下面是我的代码。在
相关问题 更多 >
编程相关推荐