Only log errors
This commit is contained in:
@@ -22,7 +22,6 @@ import {
|
||||
|
||||
export default class RentalCrawler {
|
||||
constructor (fromPage = 0, toPage = 10, maxResults = 1000) {
|
||||
console.log ('Rental Crawler');
|
||||
|
||||
this.fromPage = fromPage;
|
||||
this.toPage = toPage;
|
||||
@@ -70,7 +69,7 @@ export default class RentalCrawler {
|
||||
dataJson = JSON.parse (dataJsonString);
|
||||
break;
|
||||
} catch (e) {
|
||||
console.log ('No JSON string');
|
||||
//console.log ('No JSON string');
|
||||
if (i === lastN) throw e;
|
||||
}
|
||||
}
|
||||
@@ -95,7 +94,6 @@ export default class RentalCrawler {
|
||||
lng = dataJson['re_realEstates_longitude'];
|
||||
hasMap = true;
|
||||
} catch (e) {
|
||||
console.log ('error : ' + e);
|
||||
//This ad has no JSON string, informations should be retrieved using HTML selectors
|
||||
time = undefined;
|
||||
lat = 0;
|
||||
@@ -183,7 +181,7 @@ export default class RentalCrawler {
|
||||
|
||||
return data;
|
||||
} catch (e) {
|
||||
console.error ('Exception caught: ' + e.message);
|
||||
console.error ('[E] Exception caught: ' + e.message);
|
||||
}
|
||||
|
||||
return null;
|
||||
@@ -191,7 +189,7 @@ export default class RentalCrawler {
|
||||
|
||||
async indexPage (pageNr, maxResults = 1000) {
|
||||
try {
|
||||
console.log ('Starting to index page: ' + pageNr);
|
||||
//console.log ('Starting to index page: ' + pageNr);
|
||||
|
||||
const url = 'http://www.rental.ba/pretraga/prodaja-1/stranica-' + pageNr;
|
||||
|
||||
@@ -227,7 +225,7 @@ export default class RentalCrawler {
|
||||
|
||||
const results = {};
|
||||
for (const href of hrefs) {
|
||||
console.log (`indexing: ${href}`);
|
||||
//console.log (`indexing: ${href}`);
|
||||
|
||||
const singleData = await this.indexSingle (href);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user