Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No DefaultHandler in master branch? #57

Open
ghost opened this issue Oct 6, 2012 · 2 comments
Open

No DefaultHandler in master branch? #57

ghost opened this issue Oct 6, 2012 · 2 comments

Comments

@ghost
Copy link

ghost commented Oct 6, 2012

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.

@philipwalton
Copy link

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

@dmitris
Copy link

dmitris commented Feb 12, 2013

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants