From b3dd876989e041ff8e9412e4c720b461fd25f39e Mon Sep 17 00:00:00 2001 From: dzickusrh Date: Tue, 10 Dec 2024 03:04:52 -0500 Subject: [PATCH] Support multiple commas in zestimate (#15) Signed-off-by: Don Zickus --- zestimate.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zestimate.js b/zestimate.js index 8f6a30a..ee1ccc7 100644 --- a/zestimate.js +++ b/zestimate.js @@ -25,7 +25,7 @@ async function getZestimate(URL) { const dom = new jsdom.JSDOM(html); const zestimateText = dom.window.document.getElementById('home-details-home-values').getElementsByTagName('h3')[0].textContent; - return parseInt(zestimateText.replace('$', '').replace(',', '')) * 100; + return parseInt(zestimateText.replace('$', '').replaceAll(',', '')) * 100; } catch (error) { console.log('Error parsing Zillow page:'); console.log(error);