HTML parser

3 views
Skip to first unread message

George Moschovitis

unread,
Dec 27, 2009, 5:13:16 AM12/27/09
to nitro-devel
The Nitro ecosystem has a new member:

http://github.com/gmosx/htmlparser

an HTML parser compatible with sizzle (also included):

var HTMLParser = require("htmlparser").HTMLParser,
sizzle = require("sizzle").sizzle;

var html = '<html><p id="header"><b>nice</b></p><div id="test"
class="big">hello</div><div>second</div></html>',
parser = new HTMLParser(),
document = parser.parse(html),
$ = sizzle(document);

$("div").forEach(function(el) {
print(el.innerHTML);
});

hopefully, Tom will help integrate this with browserjs

regards,
-g.

Reply all
Reply to author
Forward
0 new messages