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

Class ArgOptions

py/selenium/webdriver/common/options.py:386–432  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

384
385
386class ArgOptions(BaseOptions):
387 BINARY_LOCATION_ERROR = "Binary Location Must be a String"
388 # FedCM capability key
389 FEDCM_CAPABILITY = "fedcm:accounts"
390
391 def __init__(self) -> None:
392 super().__init__()
393 self._arguments: list[str] = []
394
395 @property
396 def arguments(self):
397 """Returns a list of arguments needed for the browser."""
398 return self._arguments
399
400 def add_argument(self, argument: str) -> None:
401 """Adds an argument to the list.
402
403 Args:
404 argument: Sets the arguments
405 """
406 if argument:
407 self._arguments.append(argument)
408 else:
409 raise ValueError("argument can not be null")
410
411 def ignore_local_proxy_environment_variables(self) -> None:
412 """Ignore HTTP_PROXY and HTTPS_PROXY environment variables.
413
414 This method is deprecated; use a Proxy instance with ProxyType.DIRECT instead.
415 """
416 warnings.warn(
417 "using ignore_local_proxy_environment_variables in Options has been deprecated, "
418 "instead, create a Proxy instance with ProxyType.DIRECT to ignore proxy settings, "
419 "pass the proxy instance into a ClientConfig constructor, "
420 "pass the client config instance into the Webdriver constructor",
421 DeprecationWarning,
422 stacklevel=2,
423 )
424
425 super().ignore_local_proxy_environment_variables()
426
427 def to_capabilities(self):
428 return self._caps
429
430 @property
431 def default_capabilities(self):
432 return {}

Calls

no outgoing calls