Product
Introducing SSO
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
node-sizzle
Advanced tools
Readme
A node.js plugin that brings sizzle and libxmljs together. Currently it passes all relevant sizzle tests when used with an HTML document.
npm install node-sizzle
To run the tests, go to the project's root directory and run node test.js
To run the tests, go to the examples
directory and run
node web.js
var http = require('http'),
events = require('events'),
inherits = require('sys').inherits,
dominiq = require('node-sizzle/dominiq'),
sizzFact = require('node-sizzle');
function WebClient(host, path) {
var self = this,
transport = http.createClient(80, host),
request = transport.request('GET', path, {'host': host});
request.end();
request.on('response', function (response) {
if (response.statusCode != 200) {
self.emit('done', response.statusCode, '');
}
else {
var html = '';
response.setEncoding('utf8');
response.on('data', function (chunk) {
html += chunk;
});
response.on('end', function (chunk) {
self.emit('done', 200, html);
});
}
});
}
inherits(WebClient, events.EventEmitter);
var client = new WebClient('www.yahoo.com', '/');
client.on('done', function(status, html) {
if (status != 200) {
throw 'unable to download page';
}
var doc = dominiq.createHTMLDocument(html),
window = {document:doc},
sizzle = sizzFact.sizzleInit(window),
divs = sizzle('div');
for (var i = 0; i < divs.length; i++) {
console.log(divs[i].toString());
}
});
FAQs
Sizzle powered selectors for libxmljs
The npm package node-sizzle receives a total of 2 weekly downloads. As such, node-sizzle popularity was classified as not popular.
We found that node-sizzle demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.