From 822cf7b69a26c393d9f81b08ea2ab2a063e93b5d Mon Sep 17 00:00:00 2001 From: Tony Balascio Date: Fri, 14 Aug 2026 17:15:21 +0000 Subject: [PATCH] feat(auditing): GBP quality gate + Apple fallback in multi_scraper.py --- implementation/auditing/multi_scraper.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/implementation/auditing/multi_scraper.py b/implementation/auditing/multi_scraper.py index f38314b..e99711b 100644 --- a/implementation/auditing/multi_scraper.py +++ b/implementation/auditing/multi_scraper.py @@ -5,7 +5,7 @@ Extracts GBP + Apple Maps + Website, merges into verified JSON contract. Working surfaces: - Google Business Profile (via noworneverev/google-maps-scraper) - - Apple Maps (headless Firefox → /data/search JSON) + - Apple Maps (headless Firefox + /data/search JSON) - Website (direct HTTP fetch) Bot-walled (headless detection, no free bypass): @@ -42,7 +42,7 @@ async def geocode(query): except Exception: return None - m = re.search(r'"center":\{"lat":(-?\d+\.\d+),"lng":(-?\d+\.\d+)}', html) + m = re.search(r'"center":\{"lat":(-?\d+\.\d+),"lng":(-?\d+\.\d+)\}', html) if m: return float(m.group(1)), float(m.group(2)) @@ -71,7 +71,7 @@ async def scrape_google(query, coords): result = await scraper.scrape(url) if result and result.place: p = result.place - # Hours: ["Thursday9 AM–6 PM", "SundayClosed", ...] + # Hours: ["Thursday9 AM٥ PM", "SundayClosed", ...] hours_dict = {} if p.hours: for h in p.hours: @@ -123,14 +123,14 @@ def fetch_website_data(website_url): data["title"] = m.group(1).strip() # Extract meta description - m = re.search(r']*name=["\']description["\'][^>]*content=["\']([^"\']+)["\']', html, re.IGNORECASE) + m = re.search(r']*content=["\']([^"\']+)["\']', html, re.IGNORECASE) if not m: - m = re.search(r']*content=["\']([^"\']+)["\'][^>]*name=["\']description["\']', html, re.IGNORECASE) + m = re.search(r']*name=["\']description["\']', html, re.IGNORECASE) if m: data["description"] = m.group(1).strip() # Extract phone from page - phone_match = re.search(r'(\(?\d{3}\)?[\s-]?\d{3}[\s-]?\d{4})', html) + phone_match = re.search(r'(d{3}d{3}d{4})', html) if phone_match: data["phone_on_page"] = phone_match.group(1)