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

Method __init__

py/selenium/webdriver/common/service.py:52–79  ·  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

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

Callers

nothing calls this directly

Calls 1

env_pathMethod · 0.95

Tested by

no test coverage detected