From ce135fb8e8ea10122f4712bf3bbdbbd442a62565 Mon Sep 17 00:00:00 2001 From: drobnikj Date: Tue, 8 Jan 2019 09:49:45 +0100 Subject: [PATCH] Updated places extractor --- src/places_crawler.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/places_crawler.js b/src/places_crawler.js index 077a7fe..9b6f9e8 100644 --- a/src/places_crawler.js +++ b/src/places_crawler.js @@ -46,7 +46,7 @@ const extractPlaceDetail = async (page) => { // Finds values from y axis $(this).find('.section-popular-times-bar').each(function (barIndex) { const occupancyMatch = $(this).attr('aria-label').match(/\d+\s+?%/); - if (occupancyMatch) { + if (occupancyMatch && occupancyMatch.length) { const maybeHour = graphStartFromHour + barIndex; graphs[day].push({ hour: maybeHour > 24 ? maybeHour - 24 : maybeHour,