Parse HTML text into a tree of elements with selectors
$ luarocks install htmlparser
Call parse() to build up a tree of element nodes. Each node in the tree, including the root node that is returned by parse(), supports a basic set of jQuery-like selectors. Or you could walk the tree by hand.