@@ -45,8 +45,7 @@ def __repr__(self) -> str:
45
45
type (self ), self .session .session_id , self ._id
46
46
)
47
47
48
- def find_element (self , by : Union [ByType , RelativeBy ] = By .ID ,
49
- value : Optional [str ] = None ) -> WebElement :
48
+ def find_element (self , by : Union [ByType , RelativeBy ] = By .ID , value : Optional [str ] = None ) -> WebElement :
50
49
"""Find an element inside a shadow root given a By strategy and
51
50
locator.
52
51
@@ -83,11 +82,9 @@ def find_element(self, by: Union[ByType, RelativeBy] = By.ID,
83
82
by = By .CSS_SELECTOR
84
83
value = f'[name="{ value } "]'
85
84
86
- return self ._execute (Command .FIND_ELEMENT_FROM_SHADOW_ROOT , {"using" : by , "value" : value })[
87
- "value" ]
85
+ return self ._execute (Command .FIND_ELEMENT_FROM_SHADOW_ROOT , {"using" : by , "value" : value })["value" ]
88
86
89
- def find_elements (self , by : Union [ByType , RelativeBy ] = By .ID , value : Optional [str ] = None ) -> \
90
- List [WebElement ]:
87
+ def find_elements (self , by : Union [ByType , RelativeBy ] = By .ID , value : Optional [str ] = None ) -> List [WebElement ]:
91
88
"""Find elements inside a shadow root given a By strategy and locator.
92
89
93
90
Parameters:
@@ -123,8 +120,7 @@ def find_elements(self, by: Union[ByType, RelativeBy] = By.ID, value: Optional[s
123
120
by = By .CSS_SELECTOR
124
121
value = f'[name="{ value } "]'
125
122
126
- return self ._execute (Command .FIND_ELEMENTS_FROM_SHADOW_ROOT , {"using" : by , "value" : value })[
127
- "value" ]
123
+ return self ._execute (Command .FIND_ELEMENTS_FROM_SHADOW_ROOT , {"using" : by , "value" : value })["value" ]
128
124
129
125
# Private Methods
130
126
def _execute (self , command , params = None ):
0 commit comments