【发布时间】:2013-10-02 01:32:44
【问题描述】:
我必须从网页中检索文本并将其放在控制台上。 我无法从下面的这个 html 中获取文本。谁能帮我解决这个问题。
<div class="twelve columns">
<h1>Your product</h1>
<p>21598: DECLINE: Decline - Property Type not acceptable under this contract</p>
<div class="row">
</div>
我在 irb 上尝试了b.div(:class => 'twelve columns').exist?,它显示true。
我试过这个 - b.div(:class => 'twelve columns').text,它返回的不是段落中的标题文本。
我尝试使用 -b.div(:class => 'twelve columns').p.text,它返回给我error - unable to locate element, using {:tag_name=>"p"}
【问题讨论】:
-
我的回答有帮助吗?