使用节点js获取外部网站内容
在我的网站中,我使用节点js作为后端,html作为前端。 我需要获得外部网站元数据(关键字)。
有任何包获取节点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"]
我需要特别在元数据的关键字中获取所有的网站元数据。 在节点js有这个包?
我在谷歌find了一些代码。
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); });
有其他的select吗?
预期成果:
Array1 = ["keyword1","keyword2","keyword3"]; Array2 = ["keyword1","keyword2","keyword3"]; Array3 = ["keyword1","keyword2","keyword3"];
Array1,Array2,Array3是这样的Site1,Site2,Site3。