So, I have my Node.js script. And I have some HTML page which contains HTML with JavaScript (jquery) in it. How can I load it and get result of execution of JavaScript on this page?
-
1If screen scraping is what your after, check out: blog.nodejitsu.com/jsdom-jquery-in-5-lines-on-nodejsBrandon J. Boone– Brandon J. Boone2011-03-07 16:56:37 +00:00Commented Mar 7, 2011 at 16:56
-
My HTML page does some manipulations with divs -- and I need to get the result of those manipulations. It's not the screenscrapping to get the source HTML w/ Javascript, but actually the result of their execution.alexeypro– alexeypro2011-03-07 17:15:27 +00:00Commented Mar 7, 2011 at 17:15
Add a comment
|
3 Answers
You can check the zombie.js project : http://zombie.labnotes.org/
It should load the page mostly as in a real browser.
1 Comment
Ting Yi Shih
Great project!! It directly solves my problem of loading HTML after running the javascript!
Something like JSDOM should do it.
1 Comment
alexeypro
Right, but can't figure out how to I get not just HTML/JS of the window, but the result of their execution there.
Also, a great solution is https://github.com/GoogleChrome/puppeteer. Which is Headless Chrome Node API and maintained by Chrome DevTools team.
1 Comment
Manuel Di Iorio
But it is very slow at loading pages, while still faster than competitors like Phantom