INNER CODE UNIT · Python
__getattr__
browser-use/macos-harness · src/macos_harness/browser.py:155
def __getattr__(self, name: str) -> Any:
if name.startswith("_"):
raise AttributeError(name)
self.connect()
assert self._helpers is not None
try:
return getattr(self._helpers, name)
except AttributeError as exc:
raise AttributeError(f"Browser Harness has no helper {name!r}") from exc
def __repr__(self) -> str:
status = "connected" if self._helpers is not None else "lazy"
suffix = f", name={self.name!r}" if self.name else ""
return f"BrowserHarness({status}{suffix})"