Update scraper/scraper.py
All checks were successful
Build & Push Football Docker Images / build-push-update (push) Successful in 7s
All checks were successful
Build & Push Football Docker Images / build-push-update (push) Successful in 7s
Match score at start of string only, max 2 digits each side
This commit is contained in:
@@ -127,7 +127,7 @@ def scrape() -> list[dict]:
|
|||||||
time_str = "TBD"
|
time_str = "TBD"
|
||||||
if is_past:
|
if is_past:
|
||||||
# Extract just the score digits, ignore leg/aggregate text
|
# Extract just the score digits, ignore leg/aggregate text
|
||||||
score_match = re.search(r"(\d+)\s*-\s*(\d+)", mid_text)
|
score_match = re.match(r"^(\d{1,2})\s*-\s*(\d{1,2})", mid_text)
|
||||||
if score_match:
|
if score_match:
|
||||||
score_str = f"{score_match.group(1)}-{score_match.group(2)}"
|
score_str = f"{score_match.group(1)}-{score_match.group(2)}"
|
||||||
else:
|
else:
|
||||||
|
|||||||
Reference in New Issue
Block a user