Hi, I need to rip off some data from webpage. Looking at the DOM structure of that page, i figured out i need to use getElementsByClassName provided by scriptaculous. I wonder if i can use call Javascript fucntions(getElementsByClassName) in helpers? Regards, Sandeep G -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Sandeep Gudibanda wrote:> Hi, > > I need to rip off some data from webpage. Looking at the DOM structure > of that page, i figured out i need to use getElementsByClassName > provided by scriptaculous. > > I wonder if i can use call Javascript fucntions(getElementsByClassName) > in helpers? > > Regards, > Sandeep GThis function is not provided by scriptaculous but by the prototype js library (www.prototypejs.org). Anyway this function is deprecated but you can use the utility method $$ instead. See http://www.prototypejs.org/api/utility/dollar-dollar If you have added the javascript_include_tag :defaults in the head of your page u can use all of the prototype and scriptaculous functions in your app. Regards, Danny Hiemstra -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On 4 May 2008, at 08:34, Sandeep Gudibanda wrote:> > Hi, > > I need to rip off some data from webpage. Looking at the DOM structure > of that page, i figured out i need to use getElementsByClassName > provided by scriptaculous. > > I wonder if i can use call Javascript > fucntions(getElementsByClassName) > in helpers? >If what you''re saying is that you want to use these javascript functions to help you do some screen scraping from your ruby process then the answer is no (your ruby process doesn''t even have a javascript interpreter for starters). Use somthing like Hpricot. Fred --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Thanks Fred!! I thank you so often :) I guess this should work for me. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---