execute javascript in Ruby

A

Andrew Andreev

Hello all!

I use 'net/http' lib for get and parse html pages. But I also need to
execute some javascripts on pages from my ruby-scripts like on
web-browsers. Is it possible? May be there are special libraries...
Please advise.
 
K

Kaspar Schiess

I use 'net/http' lib for get and parse html pages. But I also need to
execute some javascripts on pages from my ruby-scripts like on
web-browsers. Is it possible? May be there are special libraries...
Please advise.

Have a look at watir[1] or even celerity[2] (on jruby).

Those will let you pretend to be a browser, GET/POST pages and run
javascript just as the real browser would.

kaspar

[1] http://wtr.rubyforge.org/index.html
[2] http://celerity.rubyforge.org/doc/
 
A

Aaron Patterson

Hello all!

I use 'net/http' lib for get and parse html pages. But I also need to
execute some javascripts on pages from my ruby-scripts like on
web-browsers. Is it possible? May be there are special libraries...
Please advise.

Johnson embeds a JavaScript interpreter in Ruby. You might want to
check that out:

https://github.com/jbarnette/johnson
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,169
Messages
2,570,919
Members
47,458
Latest member
Chris#

Latest Threads

Top