在我的网站中,我使用Node.js作为后端,HTML作为前端。 我需要获取外部网站的元数据(关键字)。
有没有用于在Node.js中获取元数据的包?
例如,我有一个数组中包含100个网站的URL,格式如下。
有没有用于在Node.js中获取元数据的包?
例如,我有一个数组中包含100个网站的URL,格式如下。
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"]
我需要获取所有网站元数据,特别是元数据中的关键字。在node js中是否有相关的包?
我在谷歌上找到了一些代码。
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。