36 lines
1.7 KiB
JavaScript
36 lines
1.7 KiB
JavaScript
/**
|
|
* Created by WebStorm.
|
|
* User: martin
|
|
* Date: 24/05/2020
|
|
* Time: 23:12
|
|
|
|
*/
|
|
const tape = require('tape');
|
|
const _test = require('tape-promise').default; // <---- notice 'default'
|
|
const test = _test(tape); // decorate tape
|
|
|
|
const fs = require('fs');
|
|
const cheerio = require('cheerio');
|
|
|
|
const RssTechnojobs = require('../scrapers/rss.technojobs');
|
|
|
|
const testScraper = new RssTechnojobs();
|
|
|
|
const feed = fs.readFileSync('test/data/technojobs/page1');
|
|
|
|
test.test('Test Technojobs scraper', async t => {
|
|
await testScraper.loadFeed('https://www.technojobs.co.uk/rss.php/html%20OR%20node%20OR%20web%20OR%20sql%20OR%20delphi%20OR%20javascript%20OR%20ajax/excludekeywords/locationglasgow/radius25/termsin0/salary0/postedwithinall/jobtypeall/searchfieldRSearchIndex/page1');
|
|
|
|
await testScraper.reduceItems();
|
|
|
|
await s1jobsScraper.filterAdverts();
|
|
// await s1jobsScraper.addToDB();
|
|
|
|
/* await testScraper.go('https://www.technojobs.co.uk/rss.php/html%20OR%20node%20OR%20web%20OR%20sql%20OR%20delphi%20OR%20javascript%20OR%20ajax/excludekeywords/locationglasgow/radius25/termsin0/salary0/postedwithinall/jobtypeall/searchfieldRSearchIndex/page1')
|
|
await testScraper.go('https://www.technojobs.co.uk/rss.php/html%20OR%20node%20OR%20web%20OR%20sql%20OR%20delphi%20OR%20javascript%20OR%20ajax/excludekeywords/locationLONDON/radius25/termsin0/salary0/postedwithinall/jobtypeall/searchfieldRSearchIndex/page1')
|
|
await testScraper.go('https://www.technojobs.co.uk/rss.php/html%20OR%20node%20OR%20web%20OR%20sql%20OR%20delphi%20OR%20javascript%20OR%20ajax/excludekeywords/locationMilton%20Keynes/radius25/termsin0/salary0/postedwithinall/jobtypeall/searchfieldRSearchIndex/page1')
|
|
*/
|
|
|
|
t.end();
|
|
});
|