{"record":{"id":"b304deac213038ab","repo":"D4Vinci/Scrapling","slug":"browser-executable-path-not-found-value","errorCode":null,"errorMessage":"Browser executable path not found: {value}","messagePattern":"Browser executable path not found: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"scrapling/engines/_browsers/_validators.py","lineNumber":133,"sourceCode":"            self.cookies = []\n        if not self.extra_flags:\n            self.extra_flags = []\n        if not self.selector_config:\n            self.selector_config = {}\n        if not self.additional_args:\n            self.additional_args = {}\n        if not self.capture_xhr:\n            self.capture_xhr = None\n\n        if self.init_script is not None:\n            validation_msg = _is_invalid_file_path(self.init_script)\n            if validation_msg:\n                raise ValueError(validation_msg)\n\n        if self.executable_path is not None:\n            validation_msg = _is_invalid_file_path(self.executable_path, \"Browser executable\")\n            if validation_msg:\n                raise ValueError(validation_msg)\n\n        if self.block_ads:\n            from scrapling.engines.toolbelt.ad_domains import AD_DOMAINS\n\n            if self.blocked_domains:\n                self.blocked_domains = self.blocked_domains | set(AD_DOMAINS)\n            else:\n                self.blocked_domains = set(AD_DOMAINS)\n\n\nclass StealthConfig(PlaywrightConfig, kw_only=True, frozen=False, weakref=True):\n    allow_webgl: bool = True\n    hide_canvas: bool = False\n    block_webrtc: bool = False\n    solve_cloudflare: bool = False\n\n    def __post_init__(self):\n        \"\"\"Custom validation after msgspec validation\"\"\"","sourceCodeStart":115,"sourceCodeEnd":151,"githubUrl":"https://github.com/D4Vinci/Scrapling/blob/5d213a2d4764002bfc4fed33c32fe09fa8b0bf7f/scrapling/engines/_browsers/_validators.py#L115-L151","documentation":"Raised when `executable_path` (a custom Chromium/Chrome binary) does not exist on disk. _is_invalid_file_path is called with label 'Browser executable' and its first check Path(value).exists() fails, so the ValueError reports the browser executable path as not found.","triggerScenarios":"Passing executable_path='/usr/bin/google-chrome' on a machine where it is not installed, or after the browser was upgraded/moved; wrong path in Docker images.","commonSituations":"Shipping configs between environments (macOS dev -> Linux container), depending on a system Chrome that is not installed, or Playwright's own browsers not downloaded and a wrong fallback path given.","solutions":["Verify the binary location: `which google-chrome` / `which chromium` and use that absolute path","Or omit executable_path and let camoufox/playwright manage the browser","In Docker, install the browser or copy it to the expected path"],"exampleFix":"// before\nsession = StealthySession(executable_path='/usr/bin/chromium')  # not installed\n\n// after\nimport shutil\nchrome = shutil.which('google-chrome') or shutil.which('chromium')\nsession = StealthySession(executable_path=chrome) if chrome else StealthySession()","handlingStrategy":"validation","validationCode":"from pathlib import Path\nif executable_path and not Path(executable_path).exists():\n    executable_path = shutil.which('google-chrome') or shutil.which('chromium')\n    assert executable_path, 'no system chrome found; install one or drop executable_path'","typeGuard":"def browser_binary_exists(p: str | None) -> bool:\n    return p is None or Path(p).exists()","tryCatchPattern":"try:\n    session = StealthySession(executable_path=p)\nexcept ValueError as e:\n    if 'not found' in str(e):\n        import shutil\n        session = StealthySession(executable_path=shutil.which('chromium'))\n    else:\n        raise","preventionTips":["Discover the binary with shutil.which() instead of hardcoding paths","Omit executable_path to let scrapling/playwright manage the browser","In Docker, install chromium or COPY the binary to a stable path"],"tags":["validation","file-path","browser-binary","environment"],"backgroundTag":null,"analyzedSha":"5d213a2d4764002bfc4fed33c32fe09fa8b0bf7f","analyzedAt":"2026-08-14T22:23:09.440Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}