UNPKG

node-web-crawler

Version:

Node Web Crawler is a web spider written with Nodejs. It gives you the full power of jQuery on the server to parse a big number of pages as they are downloaded, asynchronously. Scraping should be simple and fun!

26 lines (23 loc) 702 B
'use strict'; var Crawler = require('../lib/node-web-crawler'); var expect = require('chai').expect; var c; describe('Encoding', function() { beforeEach(function() { c = new Crawler({ forceUTF8: true }); }); it('should parse latin-1', function(done) { this.timeout(5000); c.queue([{ uri: 'http://czyborra.com/charsets/iso8859.html', callback: function(error, result) //noinspection BadExpressionStatementJS,BadExpressionStatementJS { expect(error).to.be.null; expect(result.body.indexOf('Jörg')).to.be.above(0); done(); } }]); }); });