tautologistics/node-htmlparser

No DefaultHandler in master branch?

Opened this issue · 2 comments

I don't know whether I'm missing something or not, please tell me if I do and excuse me if this is too obvious but there is no DefaultHandler method of htmlparser object in master branch (version 2.0.0).
I've tried using this library in my browser but when I inspect htmlparser (Tautologistics.NodeHtmlParser) object, it doesn't have such a method. However it works like a charm in 1.x version!
is there something missing from this branch? or I'm missing something?
Thanks in advance.

I just ran into the same issue. I'm not sure where to go from here.

I think you want to use HtmlBuilder instead - in the utils_example.js, I change
var handler = new htmlparser.DefaultHandler(function(err, dom) {
which produces a somewhat cryptic error
var handler = new htmlparser.DefaultHandler(function(err, dom) { ^ TypeError: undefined is not a function
to the following:
var handler = new htmlparser.HtmlBuilder(function(err, dom) {
and it works like a charm (though in that example you also need to change the variable 'class' which collides with the reserved keyword)