I\'m trying to extract email info from HTML files in my hard drive.
If I load the file in firefox and run jQuerify bookmarklet I can use successfully the following selec
jsdom
supports jQuery
with "official" way.
jsdom.env(string, [scripts], [config], callback);
Simple code:
var jsdom = require("jsdom"),
fs = require('fs');
fs.readFile('file_1.html', 'utf-8', function (err, data) {
if (err) {
throw err;
}
jsdom.env(data, ["http://code.jquery.com/jquery.js"], function (errors, window) {
var $ = window.$;
$("a.iEmail").each(function() {
console.log(this.href)
});
})
}
https://github.com/tmpvar/jsdom#easymode