Can any of Ruby's HTML Parsers do JavaScript to see the resulting DOM?
Asked Answered
M

3

7

When trying Hpricot and Nokogiri, the HTML can be fetched and parsed, but can they also execute the Javascript as well so that the content shows on the page? (shows up in the the DOM). That's because some page won't show the info unless the JavaScript initialization code has run.

Micco answered 5/9, 2010 at 19:11 Comment(0)
T
1

Not that I know of. You might want to look into using something like Watir and use a real browser.

Tragic answered 5/9, 2010 at 20:55 Comment(0)
D
1

Take a look at envjs and johnson gems.

Datha answered 13/9, 2010 at 21:41 Comment(0)
B
0

Have a look at Capybara. I haven't used it myself but I read about it the other day and it seems like it can execute javascript without using a browser.

Butacaine answered 8/9, 2010 at 8:15 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.