Skip to content
This repository

No DefaultHandler in master branch? #57

ghost opened this Issue October 05, 2012 · 2 comments

2 participants

Philip Walton Dmitri S
Deleted user

The content you are editing has changed. Reload the page and try again.

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.

Sending Request…

Attach images by dragging & dropping or selecting them. Octocat-spinner-32 Uploading your images… Unfortunately, we don't support that file type. Try again with a PNG, GIF, or JPG. Yowza, that's a big file. Try again with an image file smaller than 10MB. This browser doesn't support image attachments. We recommend updating to the latest Internet Explorer, Google Chrome, or Firefox. Something went really wrong, and we can't process that image. Try again.

Philip Walton

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

Dmitri S

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)

Andreas Madsen AndreasMadsen referenced this issue from a commit in AndreasMadsen/htmlparser2 June 23, 2013
Felix Böhm [parser] default options & cbs to empty objects
fixes #57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.