Updated result from place detail

This commit is contained in:
drobnikj 2019-01-08 09:41:10 +01:00
parent 9f1ae7fca0
commit d0bea52177

View File

@ -66,7 +66,7 @@ const extractPlaceDetail = async (page) => {
detail.totalScore = parseFloat(detail.totalScore.replace(',', '.')); detail.totalScore = parseFloat(detail.totalScore.replace(',', '.'));
detail.reviewsCount = await page.evaluate((selector) => { detail.reviewsCount = await page.evaluate((selector) => {
const numberReviewsText = $(selector).text().trim(); const numberReviewsText = $(selector).text().trim();
return (numberReviewsText) ? numberReviewsText.match(/\d+/)[0] : null; return (numberReviewsText) ? parseInt(numberReviewsText.match(/\d+/)[0]) : null;
}, reviewsButtonSel); }, reviewsButtonSel);
// If we find consent dialog, close it! // If we find consent dialog, close it!
if (await page.$('.widget-consent-dialog')) { if (await page.$('.widget-consent-dialog')) {