On Nov 8, 2013, at 7:54 PM, Dina Z.
<lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:
> Hi,Dear all,
>
> I am trying to search the phrase of numbers in a html page in the
> sentence below:
>
> <div class="Results"
id="yui_3_11_0_4_1383957936583_5009">(253
> items)</div>
>
> I used this piece of code, but it does not work,
>
> limit=
page.search("div[class=Results]").search("div").gsub("items","")
>
> begin
> Integer(limit)
> rescue
> return 0
> end
>
> Would you give me any suggestion on this?
Break apart the chain of method calls above, and see what each is returning.
--
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit
https://groups.google.com/d/msgid/rubyonrails-talk/6CFB830C-8024-4896-8E69-5361104D3A8F%40gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.