MCPcopy Create free account
hub / github.com/SeleniumHQ/selenium / __init__

Method __init__

py/selenium/webdriver/common/service.py:53–80  ·  view source on GitHub ↗
(
        self,
        executable_path: str | None = None,
        port: int = 0,
        log_output: int | str | IO[Any] | None = None,
        env: Mapping[Any, Any] | None = None,
        driver_path_env_key: str | None = None,
        **kwargs,
    )

Source from the content-addressed store, hash-verified

51 _start_timeout: float = 30
52
53 def __init__(
54 self,
55 executable_path: str | None = None,
56 port: int = 0,
57 log_output: int | str | IO[Any] | None = None,
58 env: Mapping[Any, Any] | None = None,
59 driver_path_env_key: str | None = None,
60 **kwargs,
61 ) -> None:
62 self._owns_log_output = False
63 self.log_output: int | IO[Any] | None
64 if isinstance(log_output, str):
65 self.log_output = open(log_output, "a+", encoding="utf-8")
66 self._owns_log_output = True
67 elif log_output == subprocess.STDOUT:
68 self.log_output = None
69 elif log_output is None or log_output == subprocess.DEVNULL:
70 self.log_output = subprocess.DEVNULL
71 else:
72 self.log_output = log_output
73
74 self.port = port or utils.free_port()
75 # Default value for every python subprocess: subprocess.Popen(..., creationflags=0)
76 self.popen_kw = kwargs.pop("popen_kw", {})
77 self.creation_flags = self.popen_kw.pop("creation_flags", 0)
78 self.env = env or os.environ
79 self.DRIVER_PATH_ENV_KEY = driver_path_env_key
80 self._path = self.env_path() or executable_path
81
82 @property
83 def service_url(self) -> str:

Callers

nothing calls this directly

Calls 1

env_pathMethod · 0.95

Tested by

no test coverage detected