If the parsed document has a <script> tag which is not closed, the parser acts like the document had nothing.
Example:
var
htmlparser = require('htmlparser'),
parser,
pHandler,
data = '<html><body><h1>Bla</h1><script src="somewhere"></body></html>';
pHandler = new htmlparser.DefaultHandler(function(err,doc){
if ( err )
throw err;
console.log("doc: ",doc);
});