How to search the phrase of numbers

Hi,Dear all,

I am trying to search the phrase of numbers in a html page in the
sentence below:

(253 items)

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?

Thank you,
Regards,
Di

On Nov 8, 2013, at 7:54 PM, Dina Z. [email protected] wrote:

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.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs