{"record":{"id":"37b527eb55a5ff83","repo":"D4Vinci/Scrapling","slug":"browser-executable-is-not-an-absolute-path-value","errorCode":null,"errorMessage":"Browser executable is not an absolute path: {value}","messagePattern":"Browser executable is not an absolute path: (.+?)","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 is a valid existing file but given as a relative path — the validator requires Path(value).is_absolute(). This guards against the browser subprocess resolving the path against a different working directory.","triggerScenarios":"Passing executable_path='chrome/chrome' or './browsers/chromium' that exists relative to the current directory but is not absolute.","commonSituations":"Bundling a browser in the project folder and referencing it relatively; portable deployments with relative layout assumptions.","solutions":["Resolve at runtime: str(Path('./browsers/chromium').resolve())","Or use shutil.which(), which already returns an absolute path"],"exampleFix":"// before\nsession = StealthySession(executable_path='browsers/chrome')\n\n// after\nsession = StealthySession(executable_path=str(Path('browsers/chrome').resolve()))","handlingStrategy":"validation","validationCode":"from pathlib import Path\np = str(Path(executable_path).resolve())\nassert Path(p).is_file()\nsession = StealthySession(executable_path=p)","typeGuard":"def is_absolute_binary_path(p: str) -> bool:\n    from pathlib import Path\n    return Path(p).is_absolute()","tryCatchPattern":null,"preventionTips":["Resolve bundled-browser paths at runtime with Path(...).resolve()","Prefer shutil.which() output, which is already absolute"],"tags":["validation","file-path","browser-binary","absolute-path"],"backgroundTag":null,"analyzedSha":"5d213a2d4764002bfc4fed33c32fe09fa8b0bf7f","analyzedAt":"2026-08-14T22:23:09.440Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}