The code is simple. I'm only interested in the first part of the source code of youtube.com and I'd like to stop downloading data when content-length is higher than 10000, for example. I've been trying to do it with no success. Any ideas?
var request = require('request');
var cheerio = require('cheerio');
var url = 'https://www.youtube.com/';
request(url, function(err, resp, body) {
if (err)
throw err;
$ = cheerio.load(body);
});