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

parse error #21

Closed
demian85 opened this issue Mar 3, 2011 · 4 comments
Closed

parse error #21

demian85 opened this issue Mar 3, 2011 · 4 comments

Comments

@demian85
Copy link

demian85 commented Mar 3, 2011

var util = require('util'),
    zombie = require('zombie');

var browser = zombie.visit('http://www.google.com/search?q=twitter', {
    runScripts : false,
    debug : true,
    userAgent : "Mozilla/5.0 (X11; U; Linux i686; en-US) AppleWebKit/534.13 (KHTML, like Gecko) Chrome/9.0.597.98 Safari/534.13"
}, function(err, browser, st) {
    if (err) throw err;
    browser.dump();
});

throws...

Zombie: GET http://www.google.com/search?q=twitter
Zombie: GET http://www.google.com/search?q=twitter => 200
Zombie: GET http://www.google.com/blank.html

/usr/local/lib/node/.npm/html5/0.2.14/package/lib/html5/tokenizer.js:62
                throw(e);
    ^
TypeError: Cannot read property '27' of undefined
    at EventEmitter.consume_numeric_entity (/usr/local/lib/node/.npm/html5/0.2.14/package/lib/html5/tokenizer.js:174:32)
    at EventEmitter.consume_entity (/usr/local/lib/node/.npm/html5/0.2.14/package/lib/html5/tokenizer.js:103:16)
    at EventEmitter.entity_data_state (/usr/local/lib/node/.npm/html5/0.2.14/package/lib/html5/tokenizer.js:251:20)
    at EventEmitter.<anonymous> (/usr/local/lib/node/.npm/html5/0.2.14/package/lib/html5/tokenizer.js:59:25)
    at EventEmitter.emit (events.js:42:17)
    at EventEmitter.pump (/usr/local/lib/node/.npm/html5/0.2.14/package/lib/html5/tokenizer.js:45:11)
    at EventEmitter.tokenize (/usr/local/lib/node/.npm/html5/0.2.14/package/lib/html5/tokenizer.js:78:21)
    at EventEmitter.parse (/usr/local/lib/node/.npm/html5/0.2.14/package/lib/html5/parser.js:47:17)
    at HtmlToDom.appendHtmlToElement (/usr/local/lib/node/.npm/jsdom/0.2.0/package/lib/jsdom/browser/htmltodom.js:90:50)
    at Object.innerHTML (/usr/local/lib/node/.npm/jsdom/0.2.0/package/lib/jsdom/browser/index.js:334:27)
@demian85
Copy link
Author

hello? any news? is this module in active development? I really could never use this module without getting any errors. Every time I try a new thing with the zombie module, everything breaks because of this library... is someone trying to fix this errors?

@applegrew
Copy link

I too face this issue. In tokenizer.js HTML5.WINDOWS1252 comes as undefined.

@applegrew
Copy link

Ok found the bug.

WINDOWS1252 seems to have been renamed as ENTITIES_WINDOWS1252 in constants.js but tokenizer.js still uses the old variable!

Quick fix rename HTML5.WINDOWS1252 to HTML5.ENTITIES_WINDOWS1252 in tokenizer.js. :)

@aredridel
Copy link
Owner

Fixed in v0.2.15

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

3 participants