Skip to content

Bug: European decimal comma in review counts parsed incorrectly #52

Description

@MozzamShahid

File / lines: src/gmaps_scraper/place_scraper.py, _parse_review_count (around lines 4131-4156)

Problem: The review-count parser strips every comma before converting the numeric part. For localized Google Maps pages that use a decimal comma with K/M suffix (e.g. German/Spanish/French "1,2K"), the comma is treated as a thousands separator, so 1.2K becomes float("12") * 1000 = 12000 instead of 1200.

Evidence:

number_text = match.group(1).strip()          # "1,2"
number = float(number_text.replace(",", "").replace(" ", ""))  # 12.0

Verified: "1,2K" -> 12000, "1.2K" -> 1200.

Suggested fix: When a K/M/万 suffix is present, treat a single comma as a decimal separator and convert it to . rather than removing it. Distinguish decimal-comma from grouping-comma by context.

Difficulty: good-first-issue / medium
Impact: Medium — corrupts review counts on localized Maps pages, affecting downstream ranking/confidence logic.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions