【发布时间】:2012-09-24 12:13:58
【问题描述】:
我有一个响应页面,其中包含一些文本。没有属性可以基于它从响应中获取所需的文本。有人可以给我写一个代码来做同样的事情。我已在此处附上来源。
Mux isconnected
requesting...
response got
field id="0" value="0110"field id="3" value="000000"<BR>field id="4" value="000000010000"<BR>field id="6" value="000000010000"<BR>
Response - Success
<-- 0110 000326 33444489
在上面的源代码中我想提取 [ id="0" value="0110" ] 然后在接下来的测试步骤中使用 value=0100 。
我有代码来分割文本并只使用如下所示的值
text = 'response got field id="0" value="525XXXXXXXXX66"'
matcher = text.match(/value="(.+)"/)
puts matcher.captures.first
但首先我需要提取 require 标记或文本,并在上述函数中将其指定为“文本”。
【问题讨论】:
标签: html ruby regex text watir