Live data from Hacker News

How could i grab a website and execute js on this site to get the complete dom?

news.ycombinator.com

1–5 of 5 posts

How could i grab a website and execute js on this site to get the complete dom?

#1
Hi everybody,

is there a way to grab the website and execute the javascripts? Some Websites inject Content via Javascript and Ajax and it would be great to get these.

I am porgramming in Ruby. Maybe there is a way to do this with NodeJS?

Thank you for your help

Re: How could i grab a website and execute js on this site to get the complete dom?

#3
Have you looked at Capybara + Capybara-webkit? with the :js => true option set on your test cases, you might have some success. And it's still ruby, which is nice.

https://github.com/jnicklas/capybara#calling-remote-servers https://github.com/thoughtbot/capybara-webkit