Parsing HTML with Movian.

Starting with version 4.9.389 Movian features a HTML parsing library called gumbo (see This allows parsing of a HTML DOM using APIs not very different from a normal browser.

To use it first do:

var html = require('showtime/html');

Then to parse a DOM, simply do:

var dom = html.parse('<html><body><h1>This is a heading</h1></body></html>');

The returned object contains two objects

 document: {},
 root: {}

root corresponds to the <html> element.

Element have a limited set of methods to what's available in a browser. If you find something important missing here, please let us know.

Element properties


Name of element such as a,div,span, etc


DOM3 node type, see for a list


Return all children of the node (excluding text, comment)


Return textual contents of node.


Return array of attributes for the element. The array object also have the method getNamedItem() that can be used to obtain a specific attribute by name.

Element methods


Return first element found with the given id


Return array of elements matching the given class(es). Names is a string representing the list of class names to match; class names are separated by white space.


Return array of elements matching the given tag names.


For example how to use this, see the svtplay plugin: