jsdom lets us re-render the DOM from raw HTML
xpath lets us use xpath selectors on the rendered DOM
Render a DOM from HTML
Parameters:
Returns an Object
(the rendered DOM)
Clean up an element by stripping out chains of whitespace and newlines.
Parameters:
Returns a String
(the cleaned string)
Extract a specified attribute from a node
Parameters:
node must be a Node.
(the DOM node)
attribute must be a String.
(the name of the attribute to extract)
Returns a String
(the attribute value)
Select a DOM node matching an XPath selector
Parameters:
selector must be a String.
(an XPath selector)
doc must be an Object.
(the DOM to search)
Returns a Node
(the selected node)
tools for rendering the DOM and manipulating DOM nodes