I'm pretty new with NodeJs.
I'm trying to download some html from a website in order to parse it and present some information for debug.
I try with success with http module (see this post), but in this way when I print chunk:
var req = http.request(options, function(res) {
res.setEncoding("utf8");
res.on("data", function (chunk) {
console.log(chunk);
});
});
I don't get all html that is loaded dynamically with ajax for instance:
<div class="container">
::before
<div class="row">
::before
....
</div>
Are there any other module that can help me on this goal?
Thanks!
update
I would like to share with you my success (thanks to @oKonyk).
- npm install phantomjs
- create your script
- use the same code suggested by @oKonyk
note that if you're running your script locally, you need to set this options:
options = { 'web-security': 'no' };
phantom.create({parameters: options}, function() {});