I've been playing around with cheerio and I noticed it doesn't seem to support certain selectors specified in the jquery reference, specifically ":odd" and ":even". Is there a way to use these by importing the jquery package into my program? Or is that something that has to be implemented into the cheerio code?
Here's my code:
//var request = require('request');
var cheerio = require('cheerio');
var jquery = require('./jquery-1.10.2');
var fs = require('fs');
$ = cheerio.load(fs.readFileSync('c:/java/bushkill_mls.html'));
var odds = [];
var evens = [];
$('tr:odd').each(function() {
odds = odds.concat($(this).text());
});
console.log(odds);
You can see I tried importing jquery but I couldn't get past importing it without getting the error "window is not defined" so obviously this seems like a node compatibility problem. So is there any way to increase the selector library in cheerio or maybe import another module that has the jquery selector functions I need?