# Can i use scrtipaculous functions in helpers?

**URL:** <https://www.ruby-forum.com/t/can-i-use-scrtipaculous-functions-in-helpers/136602>\
**Category:** Rails\
**Created:** [May 4, 2008, 9:34am UTC](https://www.ruby-forum.com/t/can-i-use-scrtipaculous-functions-in-helpers/136602 "2008-05-04T09:34:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sgudibanda](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/a9adbd/32.png) [@sgudibanda](https://www.ruby-forum.com/u/sgudibanda)\
**Post date:** [May 4, 2008, 9:34am UTC](https://www.ruby-forum.com/t/can-i-use-scrtipaculous-functions-in-helpers/136602/1 "2008-05-04T09:34:48Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![sgudibanda](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/a9adbd/32.png) [@sgudibanda](https://www.ruby-forum.com/u/sgudibanda)\
**Post date:** [May 4, 2008, 12:17pm UTC](https://www.ruby-forum.com/t/can-i-use-scrtipaculous-functions-in-helpers/136602/2 "2008-05-04T12:17:12Z")

</div>

Sandeep G. 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 G  
> This function is not provided by scriptaculous but by the prototype js  
> library ([www.prototypejs.org](http://www.prototypejs.org)).  
> Anyway this function is deprecated but you can use the utility method $$  
> instead.  
> See [Prototype API Documentation | $$ (Deprecated URL)](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 H.

---

<div class="post-metadata">

**Author:** ![sgudibanda](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/a9adbd/32.png) [@sgudibanda](https://www.ruby-forum.com/u/sgudibanda)\
**Post date:** [May 4, 2008, 1:49pm UTC](https://www.ruby-forum.com/t/can-i-use-scrtipaculous-functions-in-helpers/136602/3 "2008-05-04T13:49:15Z")

</div>

On 4 May 2008, at 08:34, Sandeep G. wrote:

> 

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

---

<div class="post-metadata">

**Author:** ![sgudibanda](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/a9adbd/32.png) [@sgudibanda](https://www.ruby-forum.com/u/sgudibanda)\
**Post date:** [May 4, 2008, 1:54pm UTC](https://www.ruby-forum.com/t/can-i-use-scrtipaculous-functions-in-helpers/136602/4 "2008-05-04T13:54:20Z")

</div>

Thanks Fred!! I thank you so often 🙂 I guess this should work for me.
