is there a method like 'get_meta_tags' in Node.js?
I want to extract the meta-tags from an url, especially the title and the description but i 开发者_运维技巧don't know how to do this. I tried with http://nodejs.org/docs/v0.4.2/api/http.html#http.request but i get errors like '411'.
Node only parses HTTP, not HTML or other content types. Thankfully, there is a full DOM implementation for node here:
https://github.com/tmpvar/jsdom
Load up your HTML content there, and that'll get you pretty close to your PHP example.
精彩评论