mirror of
https://github.com/davidjohnbarton/crawler-google-places.git
synced 2025-12-12 16:38:45 +00:00
Updated result from place detail
This commit is contained in:
parent
9f1ae7fca0
commit
d0bea52177
|
|
@ -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')) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user