@@ -35,10 +35,18 @@ class WebDriver(ChromiumDriver):
35
35
http://chromedriver.storage.googleapis.com/index.html
36
36
"""
37
37
38
- def __init__ (self , executable_path = DEFAULT_EXECUTABLE_PATH , port = DEFAULT_PORT ,
39
- options : Options = None , service_args = None ,
40
- desired_capabilities = None , service_log_path = DEFAULT_SERVICE_LOG_PATH ,
41
- chrome_options = None , service : Service = None , keep_alive = DEFAULT_KEEP_ALIVE ):
38
+ def __init__ (
39
+ self ,
40
+ executable_path = DEFAULT_EXECUTABLE_PATH ,
41
+ port = DEFAULT_PORT ,
42
+ options : Options = None ,
43
+ service_args = None ,
44
+ desired_capabilities = None ,
45
+ service_log_path = DEFAULT_SERVICE_LOG_PATH ,
46
+ chrome_options = None ,
47
+ service : Service = None ,
48
+ keep_alive = DEFAULT_KEEP_ALIVE ,
49
+ ):
42
50
"""
43
51
Creates a new instance of the chrome driver.
44
52
Starts the service and then creates new instance of chrome driver.
@@ -54,22 +62,30 @@ def __init__(self, executable_path=DEFAULT_EXECUTABLE_PATH, port=DEFAULT_PORT,
54
62
- service_log_path - Deprecated: Where to log information from the driver.
55
63
- keep_alive - Deprecated: Whether to configure ChromeRemoteConnection to use HTTP keep-alive.
56
64
"""
57
- if executable_path != 'chromedriver' :
58
- warnings .warn ('executable_path has been deprecated, please pass in a Service object' ,
59
- DeprecationWarning , stacklevel = 2 )
65
+ if executable_path != "chromedriver" :
66
+ warnings .warn (
67
+ "executable_path has been deprecated, please pass in a Service object" , DeprecationWarning , stacklevel = 2
68
+ )
60
69
if chrome_options :
61
- warnings .warn ('use options instead of chrome_options' ,
62
- DeprecationWarning , stacklevel = 2 )
70
+ warnings .warn ("use options instead of chrome_options" , DeprecationWarning , stacklevel = 2 )
63
71
options = chrome_options
64
72
if keep_alive != DEFAULT_KEEP_ALIVE :
65
- warnings .warn ('keep_alive has been deprecated, please pass in a Service object' ,
66
- DeprecationWarning , stacklevel = 2 )
73
+ warnings .warn (
74
+ "keep_alive has been deprecated, please pass in a Service object" , DeprecationWarning , stacklevel = 2
75
+ )
67
76
else :
68
77
keep_alive = True
69
78
if not service :
70
79
service = Service (executable_path , port , service_args , service_log_path )
71
80
72
- super ().__init__ (DesiredCapabilities .CHROME ['browserName' ], "goog" ,
73
- port , options ,
74
- service_args , desired_capabilities ,
75
- service_log_path , service , keep_alive )
81
+ super ().__init__ (
82
+ DesiredCapabilities .CHROME ["browserName" ],
83
+ "goog" ,
84
+ port ,
85
+ options ,
86
+ service_args ,
87
+ desired_capabilities ,
88
+ service_log_path ,
89
+ service ,
90
+ keep_alive ,
91
+ )
0 commit comments