@@ -45,8 +45,7 @@ def __repr__(self) -> str:
4545 type (self ), self .session .session_id , self ._id
4646 )
4747
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 :
5049 """Find an element inside a shadow root given a By strategy and
5150 locator.
5251
@@ -83,11 +82,9 @@ def find_element(self, by: Union[ByType, RelativeBy] = By.ID,
8382 by = By .CSS_SELECTOR
8483 value = f'[name="{ value } "]'
8584
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" ]
8886
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 ]:
9188 """Find elements inside a shadow root given a By strategy and locator.
9289
9390 Parameters:
@@ -123,8 +120,7 @@ def find_elements(self, by: Union[ByType, RelativeBy] = By.ID, value: Optional[s
123120 by = By .CSS_SELECTOR
124121 value = f'[name="{ value } "]'
125122
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" ]
128124
129125 # Private Methods
130126 def _execute (self , command , params = None ):
0 commit comments