add rental scraper test script

This commit is contained in:
Bilal Catic
2019-11-11 03:34:15 +01:00
parent b6024af2cb
commit cb9bb9e566
2 changed files with 19 additions and 1 deletions

17
test/rentalScrapeTest.js Normal file
View File

@@ -0,0 +1,17 @@
"use strict";
const rentalCrawler = require("../app/crawler/specificCrawlers/rental");
const urlToScrape = process.argv[2] || undefined;
if (urlToScrape) {
const crawler = new rentalCrawler();
(async () => {
const data = await crawler.scrapeAd(urlToScrape);
console.log(data);
})();
} else {
console.log("No URL to scrape. Use like this : ");
console.log("npm run test-olx-scraper -- URL_TO_SCRAPE");
}