-1

I need a way using NodeJS to make a request to a url, run some Javascript on that page, and return the HTML generated after the Javascript executes. How would I do this?

For example:

GET http://SiteToRequest.com

Run clickThis(); clickThat(); setAttribute(); on http://SiteToRequest.com

And then return the HTML scraped after the JS has run

Isaac Wasserman
  • 1,461
  • 4
  • 19
  • 39

1 Answers1

0

Node.js itself doesn't provide a browser runtime environment, but there's phantomjs (and the phantom-node integration package for node.js) that does. There's also http://zombie.js.org/ but I have no experience with it.

See can phantomjs work with node.js? where the maintainer of phantom-node explains how to use it

Community
  • 1
  • 1
imhotap
  • 2,275
  • 1
  • 8
  • 16