Can you operate on XML / HTML documents in node.js?


Is it possible to load an XML / HTML document with node.js and perform operations such as getElementsByTagName ?

Problem courtesy of: lostsource


node.js doesn’t give you a DOM “out of the box”, but there is a great module that provides a proper HTML DOM:

Edit: there are also several modules that help with interacting with XML. Here’s a list of them on the wiki (this page is deprecated):

Solution courtesy of: jmar777

View additional discussion.