在我的网站中,我将node js用于后端,并将html用于前端。我需要获取外部网站元数据(关键字)。
是否有任何程序包可用于获取节点js中的元数据?
例如,我在数组中有100个这样的网址。
var arrayName = ["http://www.realsimple.com/food-recipes/9-healthy-predinner-snacks", "http://www.womenshealthmag.com/weight-loss/100-calorie-snacks", "https://www.pinterest.com/explore/healthy-snacks/", "http://www.rd.com/slideshows/healthy-snacks-for-adults/", "http://greatist.com/snacking", "http://www.bodybuilding.com/fun/26-best-healthy-snacks.html"]
我需要获取所有网站元数据,尤其是元数据的关键字。在节点js有任何软件包吗?
我在Google中找到了一些代码。
var options = {
host: 'www.google.com',
port: 80,
path: '/index.html'
};
http.get(options, function(res) {
console.log("Got response: " + res.statusCode);
}).on('error', function(e) {
console.log("Got error: " + e.message);
});
还有其他选择吗?
预期产出:
Array1 = ["keyword1","keyword2","keyword3"];
Array2 = ["keyword1","keyword2","keyword3"];
Array3 = ["keyword1","keyword2","keyword3"];
Array1,Array2,Array3分别是Site1,Site2,Site3。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句