From 747f56941a901662b7c3ac1db645ddfa920cd022 Mon Sep 17 00:00:00 2001 From: Naida Vatric Date: Fri, 28 Feb 2020 14:21:53 +0100 Subject: [PATCH] Logged olx price scraping. --- app/crawler/specificCrawlers/olx.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/app/crawler/specificCrawlers/olx.js b/app/crawler/specificCrawlers/olx.js index ddfbcd6..cb1206d 100644 --- a/app/crawler/specificCrawlers/olx.js +++ b/app/crawler/specificCrawlers/olx.js @@ -240,13 +240,18 @@ class OlxCrawler { let price = null; let normalPrice = null; let urgentPrice = null; - const normalPriceValue = $("#pc > p:nth-child(2)").text(); + const normalPriceValue = $("#pc > p:nth-child(2)") + .text() + .trim(); const urgentPriceValue = $( "#artikal_glavni_div > div.artikal_lijevo > div:nth-child(5) > p" ) .text() .trim(); - + // + console.log("Normal price value:", normalPriceValue); + console.log("Urgent price value:", urgentPriceValue); + // if (normalPriceValue && normalPriceValue.length > 0) { normalPrice = normalPriceValue .replace(/\r\n|\n|\r/gm, "")