Watir question regarding 'span'

hi,

Get Instant Quote

Is there anyway Can I write code locate the element using the text
" Get Instant Quote "?

I can write a code like

b.span(:class,‘ui-btn-text’).click

But this :class attribute is common to every other elements, So is there
any way to locate the span using the text ’ Get Instant Quote '?

Any help?

Did you try “text”?

irb(main):003:0> b.span(text: ‘Get Instant Quote’)
=> #<Watir::Span:0x487ee79c located=false selector={:text=>“Get Instant
Quote”, :tag_name=>“span”}>
irb(main):004:0> b.span(text: ‘Get Instant
Quote’).attribute_value(‘class’)
=> “ui-btn-text”

hi, This works fine for me, thanks, yesterday I tried using the same way
but it hasn’t worked, may I might have added some space like " Get
Instant Quote ".