Use packaged Chromium driver in Docker

This commit is contained in:
2026-07-28 22:15:14 +03:30
parent 4462990d6f
commit 3982b03f5c
4 changed files with 50 additions and 21 deletions
+5 -1
View File
@@ -4,6 +4,7 @@ from __future__ import annotations
import os
import random
import re
import shutil
import subprocess
import sys
@@ -56,7 +57,10 @@ def _detect_chrome() -> tuple[str, int]:
out = subprocess.check_output(
[resolved, "--version"], stderr=subprocess.DEVNULL, text=True, timeout=5
).strip()
major = int(out.split()[-1].split(".")[0])
match = re.search(r"\b(\d+(?:\.\d+){3})\b", out)
if match is None:
continue
major = int(match.group(1).split(".")[0])
log.debug("Detected Chrome %d via '%s'", major, resolved)
return resolved, major
except Exception: