Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby/25.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby 获取标签值_Ruby_Watir - Fatal编程技术网

Ruby 获取标签值

Ruby 获取标签值,ruby,watir,Ruby,Watir,我有这个HTML: <div id="ctl00_SampleContent_FeedbackPanel" style="margin: 10px 0 0 0; padding: 3px; font-style: italic; background-color: #FFFF90;"> <span id="ctl00_SampleContent_FeedbackSelectedIndexChangedLabel"> You changed your selection

我有这个HTML:

<div id="ctl00_SampleContent_FeedbackPanel" style="margin: 10px 0 0 0; padding: 3px; font-style: italic; background-color: #FFFF90;">
<span id="ctl00_SampleContent_FeedbackSelectedIndexChangedLabel">
 You changed your selection to: 
<b>Whiskey</b>
</span>

您已将选择更改为:
威士忌
以下是页面顶部的链接:

我从下拉列表中选择了“威士忌”,然后单击提交。我需要检查我是否从下拉列表中选择了“威士忌”。那么,如何使用watir获得威士忌价值?

browser.b(文本:“威士忌”).text 行得通