Library for Nodejs that retrieve the DOM and global vars from a remote html page.

npm version

Licensed under the MIT license.

Copyright Stefano Cudini

Source code

Github
NPM

$ npm install  node-fetch-dom --save
var fetchdom = require('node-fetch-dom');

/*
  by default return the window object
*/
fetchdom('http://labs.easyblog.it/', function(window) {

	console.log(window.document.body);
});

/*
  specify sub property of default DOM
*/
fetchdom('http://labs.easyblog.it/', 'location.href', function(href) {

	console.log(href);

});

/*
  parsing of global remote variables (in remote page is defined window.allTags = {...}; )
*/
fetchdom('http://labs.easyblog.it/', 'allTags', function(tags) {

	console.log(tags);

});
Load More Related Articles
Load More By john
Load More In Javascript

Leave a Reply

Your email address will not be published. Required fields are marked *

Check Also

Tips for stronger online security

The online security is one of our main concerns everyone, especially now that electronic d…